jeliot Posted April 1, 2006 Share Posted April 1, 2006 Newbie questionwhen 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 scriptthanks Link to comment https://forums.phpfreaks.com/topic/6352-sql-syntax-error-line-1/ Share on other sites More sharing options...
Barand Posted April 1, 2006 Share Posted April 1, 2006 It means the first line of the SQL queryIf 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 More sharing options...
jeliot Posted April 1, 2006 Author Share Posted April 1, 2006 [!--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 queryIf 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 More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.