DLR Posted January 19, 2010 Share Posted January 19, 2010 Please see if you can see the mistake I must be making. I keep getting the error 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 '@signforce.co.za AND client_dbase = signforce AND worker_status = 1' at line 2 $a = $_SESSION['worker_name']; $b = $_SESSION['worker_email']; $c = $_SESSION['client_database']; $query = "SELECT * FROM staff WHERE worker_name = $a AND worker_email = $b AND client_dbase = $c AND worker_status = 1 "; $result = mysql_query($query) or die(mysql_error()); This should be sooooooo simple! Thanks Quote Link to comment Share on other sites More sharing options...
PFMaBiSmAd Posted January 19, 2010 Share Posted January 19, 2010 String data in a query must be enclosed in single-quotes so that it is treated as string data instead of keywords or identifiers. Quote Link to comment Share on other sites More sharing options...
DLR Posted January 19, 2010 Author Share Posted January 19, 2010 Thank you. Solved, but I have tried that over and over - still same error, yet now . . . oh well. 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.