Posts: 1,832
Location: Somewhere else entirely
|
Ok first off, your for loop reuses the $result variable, so only the last one actually gets retained. You need to do something with $result before you run the next query, other wise the next query just overwrites it. I would process the first set of results and echo them out, then run the next query.
Also your loop is going round once too many - use < instead of <=. For two search terms it will loop with i=0, then i=1 and finally i=2. $search_words[2] has no value, and this might what is causing the whole database to be returned, since you are searching for things LIKE ''.
__________________
UPDATE 0beron SET talkupation = talkupation + lots WHERE post = 'helpful';
Please login or register to view this content. Registration is FREE (aka MSN handwriting for forums)
|