webguync Posted December 13, 2010 Share Posted December 13, 2010 anyone know why i would be getting errors in these SQL statements or how to debug? $sql3="SELECT FROM $tbl_name2(`id`,`FirstName`,`LastName`,`Username`,`Password`,`Password2`,`email`,`Zip`,`Birthday`,`Security`,`Security2`) VALUES ('$id','$FirstName','$LastName','$UserName','$Password','$Password2','$email','$Zip','$Birthday','$Security','$Security2')"; $result3=mysql_query($sql3) or die(mysql_error()); $sql5="select * from $tbl_name where username = '$UserName'"; the error(s) is just the generic one such as You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'FROM (`id`,`FirstName`,`LastName`,`Username`,`Password`,`Password2`,`email`,`Zip' at line 1 Link to comment https://forums.phpfreaks.com/topic/221549-errors-in-sql-syntax/ Share on other sites More sharing options...
AbraCadaver Posted December 13, 2010 Share Posted December 13, 2010 Two problems that I see: echo $tbl_name2; Also: SELECT ?WHAT? FROM $tbl_name2 Link to comment https://forums.phpfreaks.com/topic/221549-errors-in-sql-syntax/#findComment-1146851 Share on other sites More sharing options...
btherl Posted December 13, 2010 Share Posted December 13, 2010 webguync, did you want to insert data to the database or select it from the database? Link to comment https://forums.phpfreaks.com/topic/221549-errors-in-sql-syntax/#findComment-1146863 Share on other sites More sharing options...
webguync Posted December 13, 2010 Author Share Posted December 13, 2010 with that particular SQL statement Select All, so I guess I don't need the values :-) Link to comment https://forums.phpfreaks.com/topic/221549-errors-in-sql-syntax/#findComment-1146866 Share on other sites More sharing options...
AbraCadaver Posted December 13, 2010 Share Posted December 13, 2010 webguync, did you want to insert data to the database or select it from the database? Haha, I missed the most obvious one :'( Link to comment https://forums.phpfreaks.com/topic/221549-errors-in-sql-syntax/#findComment-1146876 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.