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. 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 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 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
Archived
This topic is now archived and is closed to further replies.