I have this: $query = "SELECT * FROM businesses WHERE active='1' AND zipa='$_GET[search]' OR extrazips LIKE '%$_GET[search]%' ORDER BY id DESC LIMIT $offset, $rowsPerPage"; PHP: Except that doesn't work.... Is there a way to block them off to let mysql know how to evaluate it? ex: $query = "SELECT * FROM businesses WHERE active='1' AND (zipa='$_GET[search]' OR extrazips LIKE '%$_GET[search]%') ORDER BY id DESC LIMIT $offset, $rowsPerPage"; PHP:
You could remove the "active='1'" clause, and remove partenthesis. Then while looping you could then have an if statement: "if ($row['active'] == 1) {"
DUH! thanks that should work... however... when looping through a bunch of rows that could be a problem. Any other ideas?