acmbar Posted March 28, 2010 Share Posted March 28, 2010 Hi folks, I get the above error when i run the following code: mysql_connect("localhost.baristajob.com.au","baristaj_Admin","baristajob01"); mysql_select_db ("baristaj_employment"); $getuser= mysql_query ( "SELECT email FROM users WHERE username ={$_SESSION['username']}") or die (mysql_error()); echo "$getuser"; Any help is appreciated! Link to comment https://forums.phpfreaks.com/topic/196742-unknown-column-admin-in-where-clause-error-msg/ Share on other sites More sharing options...
Zane Posted March 28, 2010 Share Posted March 28, 2010 you gotta put the session var here... username ={$_SESSION['username']} in quotes; or else it thinks the value of the session var is a column.. or column alias username = '{$_SESSION['username']}' Link to comment https://forums.phpfreaks.com/topic/196742-unknown-column-admin-in-where-clause-error-msg/#findComment-1032863 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.