Hey,
I have a search feature on my site, this searchs the users of the site and displays the profile depending on the search criteria,
however there is a field in the user table that is either TRUE or FALSE and i need to exlude all the reults that are FALSE from any search.
Is there a simple bit of code i need or is it something more complicated?
Cheers,
Slater
Excluding certain results.
Moderator: General Moderators
You need a query like this
That will exclude all rows where field = FALSE
Mark
Code: Select all
SELECT * FROM sometable WHERE field = 'TRUE'Mark
Sorry should have also said there is already one WHERE in the statement, does this matter?
here it is(modified):
Cheers
here it is(modified):
Code: Select all
$sql = "SELECT * from questions WHERE field = 'TRUE' WHERE q_page>$page order by q_seq ascs";Try this
Mark
Code: Select all
$sql = "SELECT * FROM questions WHERE field = 'TRUE' && q_page>$page ORDER BY q_seq ASC";