Jump to content

SQL syntax error line 1


jeliot

Recommended Posts

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]
Link to comment
https://forums.phpfreaks.com/topic/6352-sql-syntax-error-line-1/#findComment-22954
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
Link to comment
https://forums.phpfreaks.com/topic/6352-sql-syntax-error-line-1/#findComment-22981
Share on other sites

Archived

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

×
×
  • Create New...

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.