= does not take the wildcard (%). 

-----Original Message-----
From: Harry.de [mailto:[EMAIL PROTECTED]
Sent: Friday, March 28, 2003 2:38 PM
To: [EMAIL PROTECTED]
Subject: [PHP] mySQL query - command "LIKE" OR "="


 Hi,
i want to make a mySQL query where the result should be

in $result1
any sting with a phrase of $search

in $result2
any sting with the exact phrase of $search

$result1 works fine, but $result2 gives out an empty sting

 $result1 = mysql_query("SELECT name FROM table WHERE name LIKE
'%".strtolower($search)."% ");
 $result2 = mysql_query("SELECT name FROM table WHERE name =
'%".strtolower($search)."% ");


e.g.
row 1 in name = "my big appletree in the garden"
row 2 in name = "my big apple in the garden"

so the result should be in $result2 with $search="apple"
2


Can anybody help me


Harry



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to