Jump to content

MYSQL / PHP Query Help


seanpatten11

Recommended Posts

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 = "&quot$servername&quot";

$stringjobname = "&quot$vjobname&quot";

 

$queryemails = mysql_query("SELECT * FROM `emails` WHERE `subject` like '$searchstatus' AND `subject` like '%$stringservername%' AND `subject` like '%$stringjobname%' AND `fromemail` = '$matchfrom'");

 

 

 

Any suggestions? :)

 

Thankyou

 

Link to comment
https://forums.phpfreaks.com/topic/249977-mysql-php-query-help/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.