Edit: This IS a MySQL question, my fault.
Hi, I created a search feature and submitted it here a couple of months ago and being pretty much satisfied with it I went on to try and rewrite my main page into strict CSS. Heh, the hardest thing with CSS is that it behaves so very different depending on the browser.
My PHP and MySQL knowledge feels like it has atrophied a bit since I spent so much time on CSS as opposed to PHP and MySQL and my original script looks slightly foreign to myself.
The original thread is here.
The script in action is here.
The source script is here.
The code to be edited is listed here:
What I want to do is add a concat command so that the script will search the specified columns of a table so if there is a match in any or all of the 3 or 4 columns of a row of a table (in this case there are a few different tables) it will display only one result as opposed to listing one result for each column and each table where there is a match.PHP Code:$k=count($terms1);
$trm = array();
$where_clause=array();
$l=0;
$tt1=-1;
while ($l<=$j){$l++;
while ($tt1<$k-1){$tt1++;
$trm[] = " $rip1[$l] LIKE '%$terms1[$tt1]%' ";
}$tt1=-1; $where_clause[] = " WHERE " . implode (" and ",$trm);unset($trm);
}
$r=count($where_clause);
$tt1=0;
$tt=0;
In short I want the script to be more efficient in its results.
Thanks for reading. The hard part about asking for help in a forum is knowing the right question to ask and making the question clear.
EDIT: I need to extend the where statement to include the columns that I want as opposed to the one specified in each where statement. It is beginning to come back to me (I hope).



Reply With Quote
Bookmarks