seanpatten11 Posted October 28, 2011 Share Posted October 28, 2011 I have the following MYSQL Query: Basically, the query will not work when i add quotes to the string. I want it to select from e-mails database where subject LIKE '%"$stringservername"%' If I do just '%$SERVERNAME%' it works :S - And the mysql data includes the quotes. I use the $strongservername to add the quotes. $stringservername = ""$servername""; $stringjobname = ""$vjobname""; $queryemails = mysql_query("SELECT * FROM `emails` WHERE `subject` like '$searchstatus' AND `subject` like '%$stringservername%' AND `subject` like '%$stringjobname%' AND `fromemail` = '$matchfrom'"); Any suggestions? Thankyou Quote Link to comment https://forums.phpfreaks.com/topic/249977-mysql-php-query-help/ Share on other sites More sharing options...
AyKay47 Posted October 28, 2011 Share Posted October 28, 2011 not fully understanding.. why are you manually adding quotes to your search criteria? it looks like $queryemails should work.. im assuming that it doesn't? Quote Link to comment https://forums.phpfreaks.com/topic/249977-mysql-php-query-help/#findComment-1282965 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.