Try using parentheses inside your sql:
Select * from table_name where (col1=1 OR col2=1) and col3=0
Select * from table_name where col1=1 OR (col2=1 and col3=0)
They make a big difference, also helps to indentify what you're selecting when you
come back to the sql later.
Adam
Hi there :)
You could construct seperate queries for every possible combination of
search provided you don't have a huge number of search criteria (form
elements for your search)
.
I did this just recently for a friend finder site. In the search the user
has four fields that are automatically
PROTECTED]
Subject: [PHP-DB] Re: multiple select statements
Hi there :)
You could construct seperate queries for every possible combination of
search provided you don't have a huge number of search criteria (form
elements for your search)
.
I did this just recently for a friend finder
=SELECT * FROM list WHERE $sWhere
}
*
- Original Message -
From: Leotta, Natalie (NCI/IMS) [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, March 05, 2002 8:50 AM
Subject: RE: [PHP-DB] Re: multiple select statements
I'd try building it piece
I've done stuff like this in VBScript and haven't yet done it in PHP,
so this advice may be worth what you're paying for it:
1. Make sure you've got a space in your sql string.
$query .= WHERE MANUFACTURER LIKE '$manufacturername'
should be
$query .= WHERE MANUFACTURER LIKE