Hyperjase Posted January 8, 2012 Share Posted January 8, 2012 Hey all, Trying to search for something within a database, using two different fields, one text box and one drop down (the values are actually table names). Here is what I have, this doesn't work: <?php $result = mysql_query("SELECT * FROM cakeorder WHERE `{$_SESSION['name']}` = '".$_SESSION['search']. "'"); Thanks! Jason Link to comment https://forums.phpfreaks.com/topic/254610-use-_session-within-mysql-search/ Share on other sites More sharing options...
PaulRyan Posted January 8, 2012 Share Posted January 8, 2012 Try echoing out the $_SESSION variables and the query to make sure they are what you expect. Regards, PaulRyan. Link to comment https://forums.phpfreaks.com/topic/254610-use-_session-within-mysql-search/#findComment-1305591 Share on other sites More sharing options...
Hyperjase Posted January 8, 2012 Author Share Posted January 8, 2012 My boob, it was outputting correctly, I had the search the wrong way round and needed to change ' for ` on the table name! Thanks, Jason Link to comment https://forums.phpfreaks.com/topic/254610-use-_session-within-mysql-search/#findComment-1305595 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.