Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4

Thread: funny error

  1. #1
    Regular Coder
    Join Date
    Aug 2007
    Location
    maine,usa
    Posts
    151
    Thanks
    2
    Thanked 1 Time in 1 Post

    funny error

    heres the code
    PHP Code:
    while($row mysql_fetch_array($return)){
                    
    $num count_com($row['blog.b_id']);
                    if(
    $i == 0){
                        echo 
    '<tr><td class="alt">'.$row['blog.b_id'].'</td><td class="alt">'.$row['blog.title'].'</td><td class="alt">'.$row['blogdate'].'</td><td class="alt">'.row['blog.author'].'</td><td class="alt">'.$num.'<td class="alt"><a class="link" href="post?id='.$row['blog.b_id'].'">Veiw Post</a></td></tr><td class="alt">edit</td><td class="alt">Delete</td></tr>';
                    }
                    else{
                        echo 
    '<tr><td>'.$row['blog.b_id'].'</td><td>'.$row['blog.title'].'</td><td>'.$row['blogdate'].'</td><td>'.row['blog.author'].'</td><td>'.$num.'<td><a class="link" href="post?id='.$row['blog.b_id'].'">Veiw Post</a></td></tr><td>edit</td><td>Delete</td></tr>';;
                    }
                    
    $i++;
                } 
    Parse error: syntax error, unexpected '[', expecting ',' or ';' in /home/richard/labs/admin/manage.php on line 27

    this doesnt make sense i cant find it.

  • #2
    Senior Coder CFMaBiSmAd's Avatar
    Join Date
    Oct 2006
    Location
    Denver, Colorado USA
    Posts
    3,066
    Thanks
    2
    Thanked 319 Times in 311 Posts
    One $row[...] variable in each of the echo statements is missing the $ on the front of the variable name.
    If you are learning PHP, developing PHP code, or debugging PHP code, do yourself a favor and check your web server log for errors and/or turn on full PHP error reporting in php.ini or in a .htaccess file to get PHP to help you.

  • #3
    Banned
    Join Date
    Apr 2007
    Posts
    428
    Thanks
    29
    Thanked 5 Times in 5 Posts
    and you have two ; after echo in else

  • #4
    Regular Coder
    Join Date
    Aug 2007
    Location
    maine,usa
    Posts
    151
    Thanks
    2
    Thanked 1 Time in 1 Post
    Thanks, Let night coding gets to you. I ended up rewriting the whole thing differently.


  •  

    Posting Permissions

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