Help with a search array.
| From: | Philip J. Newman | Date: | Wed, 06 Mar 2002 21:08:00 +0000 |
| Subject: | Help with a search array. | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-87524@lists.php.net to get a copy of this message | ||
heres my example:
I want to break up the search words in a string.
eg: $q = green eggs
would like that to be
$q1 = green
$q2 = eggs
... then ....
the mysql process
$sql = "";
for ($i = 0; $i < $num; $i++)
if (strlen($getme_arr[$i]) > 0)
$sql .= " '%".$getme_arr[$i]."%'";
$sql .= " ORDER BY
id ASC LIMIT 0, 30";
... This should send to my sql ...
SELECT * FROM hyperlinks WHERE 1 AND keywords LIKE "green" AND
keywords LIKE "eggs" ORDER BY id ASC LIMIT 0, 30
How ever it really down't want to work. Any Suggestions
Philip J. Newman
PhilipNZ :: Design Solutions
http://www.philipnz.com/
info@philipnz.com
ICQ# 20482482
+64 25 6144012