SitePoint Sponsor

User Tag List

Results 1 to 5 of 5

Thread: parse error...

  1. #1
    Serial Publisher silver trophy aspen's Avatar
    Join Date
    Aug 1999
    Location
    East Lansing, MI USA
    Posts
    12,937
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    added a new query to a page of mine - getting a parse error on the footed include, remove the new query, parse error goes away.

    Code:
    .
    .
    .
    .
    
    <?
    
    $result = mysql_query("SELECT * FROM links WHERE id like '$bid'", $db);
    if (!$result) {  echo("<P>Error performing query: " . mysql_error() . "</P>");  
    exit();
    
    ?>
    </td>
    </tr>
    </table>
    
    <? include("foot_inc.php3"); ?>
    Now it says the error is on the include line but its not. And I dont see any error above it. I have no idea.
    Chris Beasley - I publish content and ecommerce sites.
    Featured Article: Free Comprehensive SEO Guide
    My Guide to Building a Successful Website
    My Blog|My Webmaster Forums

  2. #2
    Dumb PHP codin' cat
    Join Date
    Aug 2000
    Location
    San Diego, CA
    Posts
    5,460
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Missing a closing bracket after the query you addded should read:

    Code:
    $result = mysql_query("SELECT * FROM links WHERE id like '$bid'", $db);
    if (!$result) {  
    echo("<P>Error performing query: " . mysql_error() . "</P>");  
    exit();
    }
    or
    Code:
    $result = mysql_query("SELECT * FROM links WHERE id like '$bid'", $db);
    if (!$result) {  echo("<P>Error performing query: " . ysql_error() . "</P>"); exit(); }
    Please don't PM me with questions.
    Use the forums, that is what they are here for.

  3. #3
    Serial Publisher silver trophy aspen's Avatar
    Join Date
    Aug 1999
    Location
    East Lansing, MI USA
    Posts
    12,937
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thanks... thats the most annoying thing of coding... the damn typos and little mistakes you spend hours staring at but dont see.
    Chris Beasley - I publish content and ecommerce sites.
    Featured Article: Free Comprehensive SEO Guide
    My Guide to Building a Successful Website
    My Blog|My Webmaster Forums

  4. #4
    Dumb PHP codin' cat
    Join Date
    Aug 2000
    Location
    San Diego, CA
    Posts
    5,460
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Chris 99% of the time when it says parse error on a line that definitely does not contain a parse error, look one or two lines above that one.
    Please don't PM me with questions.
    Use the forums, that is what they are here for.

  5. #5
    <? echo "Kick me"; ?> petesmc's Avatar
    Join Date
    Nov 2000
    Location
    Hong Kong
    Posts
    1,508
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Also, if it says that the parse error is on the last line then you have forgotten a curly bracket }

    Lastly, I find a missing " or ; is always make php say a line lower.

    Eg,

    Error on line 9 but php says line 10


Bookmarks

Posting Permissions

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