Results 1 to 4 of 4
  1. #1
    Join Date
    Sep 2008
    Posts
    2

    Question Unanswered: unexpected T_DOUBLE_ARROW (was "Please Help Me")

    I have this code I just added to my forum and now I get this error, unexpected T_DOUBLE_ARROW

    I have did a little research but sill cant figure it out.
    Does anything in this code look wrong?

    PHP Code:
    // Start output Ad
        
    $adID '';
        
    $forum_id = isset($f) ? $f 0;
        
    $sql "SELECT a.code, a.ad_id, a.position, a.type, a.image, a.url, a.height, a.width
            FROM " 
    AD_TABLE ." a, " USER_GROUP_TABLE " g
            WHERE (a.max_views >= a.views OR a.max_views = '0')
            AND (FIND_IN_SET(" 
    .$forum_id", a.show_forums) > 0 OR a.show_all_forums = '1')
            AND g.user_id = " 
    $user->data['user_id'] . "
            AND FIND_IN_SET(g.group_id, a.groups)
            AND FIND_IN_SET(" 
    $user->data['user_rank'] . ", a.ranks)
            AND a.start_time < " 
    time() . "
            AND a.end_time > " 
    time() . "
            AND (a.clicks <= a.max_clicks OR a.max_clicks = '0')
            ORDER BY rand()"
    ;
        
    $result $db->sql_query($sql);
                
        while(
    $row $db->sql_fetchrow($result))
        {
            if (
    $row['type'] == 2)
            {
                
    $adcode[$row['position']] = '<a href="' $phpbb_root_path 'adclick.' $phpEx '?id=' $row['ad_id'] . '"><img src="' $row['image'] . '" height="' $row['height'] . '" width="' $row['width'] . '" alt="" /></a>';
            }
            else
            {
                
    $adcode[$row['position']] = html_entity_decode($row['code']);
            }
            
    $adID[$row['position']]['ID'] = $row['ad_id'];
        }
        
    $db->sql_freeresult($result);
        
        
    // update views for every Ad
        
    for ($i 1$i <= 6$i++)
        {
            if (isset(
    $adID[$i]['ad_id']))
            {
                
    $db->sql_query('UPDATE ' AD_TABLE ' SET views = views +1 WHERE ad_id = ' $adID[$i]['ad_id']);
            }
        }
        
    // End output Ad


        // The following assigns all _common_ variables that may be used at any point in a template.
        
    $template->assign_vars(array(
            
    'AD_CODE1'  => isset($adcode[1]) ? $adcode[1] : '',
            
    'AD_CODE2'  => isset($adcode[2]) ? $adcode[2] : '',
            
    'AD_CODE3'  => isset($adcode[3]) ? $adcode[3] : '',
            
    'AD_CODE4'  => isset($adcode[4]) ? $adcode[4] : '',
            
    'AD_CODE5'  => isset($adcode[5]) ? $adcode[5] : '',
            
    'AD_CODE6'  => isset($adcode[6]) ? $adcode[6] : ''

  2. #2
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    what line does the error appear on
    what steps have you taken to work out what may be wrong
    I'd rather be riding on the Tiger 800 or the Norton

  3. #3
    Join Date
    Mar 2007
    Location
    010101010110100
    Posts
    803
    Your problem is in your array in the last 6 lines of your code. I have never seen an array set up like that but when you refer to key/pair values in php you need to do so like this:

    Code:
    array('key'=>'value')

  4. #4
    Join Date
    Sep 2008
    Posts
    2
    I figured it out, it was as simple as an extra one of these )

    Thanks for the help..

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •