Jump to content

mysql query question


networkthis

Recommended Posts

I am fairly new to mysql, I have a question on the following:

I am trying to match keywords entered into my search all box with any of the fields in my table as long as my status field is set to active: This works great as long as I use only 1 LIKE field, however when I enter multiple LIKE fields into my query I get a different number of search results if I reverse the words.... 

 

<?php

if ($search_all) {
    foreach ($search_all_array as $trimm){
$query = "SELECT * FROM db WHERE long_description LIKE '%$trimm%' OR short_description LIKE '%$trimm%' OR city LIKE '%$trimm%' AND status LIKE '%active%'";}

?>

 

Any ideas?? Thanks

Link to comment
https://forums.phpfreaks.com/topic/132666-mysql-query-question/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.