rhyspaterson Posted July 4, 2007 Share Posted July 4, 2007 Hey guys, Trying to run quite a simple piece of code: $query = "SELECT * FROM usr WHERE regno = $registrationID"; However i am getting syntax errors at the end of the line, but not sure what i am doing wrong.. any suggestions? Cheers Quote Link to comment Share on other sites More sharing options...
teng84 Posted July 4, 2007 Share Posted July 4, 2007 can you send us the error Quote Link to comment Share on other sites More sharing options...
rhyspaterson Posted July 4, 2007 Author Share Posted July 4, 2007 Warning: pg_query() [function.pg-query]: Query failed: ERROR: syntax error at end of input LINE 1: SELECT * FROM usr WHERE regno = ^ in /var/www/menu/client/form/process.php on line 11 Query failed: ERROR: syntax error at end of input LINE 1: SELECT * FROM usr WHERE regno = ^ Quote Link to comment Share on other sites More sharing options...
teng84 Posted July 4, 2007 Share Posted July 4, 2007 $query = "SELECT * FROM usr WHERE regno = ".$registrationID.""; try that or check if $registrationID has value Quote Link to comment Share on other sites More sharing options...
trq Posted July 4, 2007 Share Posted July 4, 2007 $query = "SELECT * FROM usr WHERE regno = '$registrationID'"; Quote Link to comment Share on other sites More sharing options...
rhyspaterson Posted July 4, 2007 Author Share Posted July 4, 2007 Thanks for the reply. I have tried that above code previously as well. However i receive a different error message: Warning: pg_query() [function.pg-query]: Query failed: ERROR: invalid input syntax for integer: "" in /var/www/menu/client/form/process.php on line 11 Query failed: ERROR: invalid input syntax for integer: "" I do checks to ensure $registrationID is not NULL and is only numbers. Any suggestions? Quote Link to comment Share on other sites More sharing options...
rhyspaterson Posted July 4, 2007 Author Share Posted July 4, 2007 Ah sorry, yes the above code did work. Thank you v. much Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.