Etherwood Posted December 7, 2009 Share Posted December 7, 2009 Can someone help me out here... mysql_query("SELECT * FROM staffdb WHERE fname LIKE '$searchquery'"); I want to change fname to a variable, for example WHERE '$searchtype' LIKE. The script works using fname, but whenever changing this to a variable it can't find results from the sql. Quote Link to comment https://forums.phpfreaks.com/topic/184209-this-is-annoying-me-now/ Share on other sites More sharing options...
genericnumber1 Posted December 7, 2009 Share Posted December 7, 2009 Dont' have quotes around it. WHERE $searchtype LIKE Quote Link to comment https://forums.phpfreaks.com/topic/184209-this-is-annoying-me-now/#findComment-972553 Share on other sites More sharing options...
Etherwood Posted December 7, 2009 Author Share Posted December 7, 2009 Your a star Quote Link to comment https://forums.phpfreaks.com/topic/184209-this-is-annoying-me-now/#findComment-972558 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.