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 Link to comment https://forums.phpfreaks.com/topic/189057-impossible-syntax-error-query-does-not-like-and-operator/ 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. Link to comment https://forums.phpfreaks.com/topic/189057-impossible-syntax-error-query-does-not-like-and-operator/#findComment-998204 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. Link to comment https://forums.phpfreaks.com/topic/189057-impossible-syntax-error-query-does-not-like-and-operator/#findComment-998214 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.