Jump to content

Archived

This topic is now archived and is closed to further replies.

jeliot

SQL syntax error line 1

Recommended Posts

Newbie question

when the SQL error says line on does that mean line of the whole HTML/PHP script or just the first line of the actuall php script in the HTML script

thanks

Share this post


Link to post
Share on other sites
It means the first line of the SQL query

If you put the query all on one line then the error, if there is one, wil always be on line 1.

[code]SELECT a.cola, b.colb, b.colc FROM table1 a INNER JOIN table2 b ON a.cola = b.cola WHERE b.colc = '$x' AND b.colx = 42[/code]

or you could split it over several lines

[code]SELECT a.cola, b.colb, b.colc
FROM table1 a
        INNER JOIN table2 b ON a.cola = b.cola
WHERE b.colc = '$x'
        AND b.colx = 42[/code]

Share this post


Link to post
Share on other sites
[!--quoteo(post=360686:date=Apr 1 2006, 03:13 PM:name=Barand)--][div class=\'quotetop\']QUOTE(Barand @ Apr 1 2006, 03:13 PM) [snapback]360686[/snapback][/div][div class=\'quotemain\'][!--quotec--]
It means the first line of the SQL query

If you put the query all on one line then the error, if there is one, wil always be on line 1.

[code]SELECT a.cola, b.colb, b.colc FROM table1 a INNER JOIN table2 b ON a.cola = b.cola WHERE b.colc = '$x' AND b.colx = 42[/code]

or you could split it over several lines

[code]SELECT a.cola, b.colb, b.colc
FROM table1 a
        INNER JOIN table2 b ON a.cola = b.cola
WHERE b.colc = '$x'
        AND b.colx = 42[/code]
[/quote]


thanks atleast i have a starting point to find the problem

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.