THX! How the f* do you find these things?!!! I looked at the manual for like an hour then got bored and figured it wasnt in the manual... o well... i aint no genius.... lets see if you can further amaze me....
My last problem (as far as I can see...) I can ALMOST guarantee that this will not be in the manual.. exept if someone posted it in the user comments.. doubt that...
I want to search a database without using FULLTEXT... I DO HAVE A REASON FOR THAT!!!! IM NOT THAT BIG OF AN IDIOT π!!!!
Ok... I need to split up the search string into words
$strarray = explode(' ',$q);
($q is the search var)
Then I need to search the database and select all the rows that contain each word
foreach ($strarray as $stritem) {
$res = mysql_query("SELECT * FROM searchtable WHERE keywords LIKE('%$stritem%') LIMIT 0, 10");
while($row=mysql_fetch_array($res11)) {
if($row[URL] != "" AND $row[Description] != "" AND $row[Title] != "") {
echo "url: $row[URL] title: $row[Title] description: $row[Description]";
}
}
}
Now... how do I prevent the same row from being displayed twice??? The URL column is a unique key so it can .. i think... be done by putting each row's url into an array as we go and then before displaying the results (echo) we test if the url is in the array
if(in_array($row[URL],$url) != TRUE) {
echo "url: $row[URL] title: $row[Title] description: $row[Description]";
}
Now how do I make it put each URL into an array.. and make it so that in_array works??!? plz help or suggest new way.