Re: [PHP-DB] SELECT query with multiple WHERE Clause

2008-02-27 Thread Chris
$query = mysql_query(SELECT * from gig WHERE gigName='$gig_name' OR WHERE gig_fdate='$sdate'); This one. I'd suggest you get a book to help you with the basics, something like this should do (first hit in amazon, haven't actually read this particular book):

Re: [PHP-DB] SELECT query with multiple WHERE Clause

2008-02-27 Thread Greg Bowser
In MySQL, both OR and || are valid logical or operators. You can only have one Where clause, thus your last example is correct. --GREG On Wed, Feb 27, 2008 at 6:44 PM, Nasreen Laghari [EMAIL PROTECTED] wrote: Hi All, Thank you for increasing my knowledge about PHP/MYSQL. I am creating a

Re: [PHP-DB] SELECT query with multiple WHERE Clause

2008-02-27 Thread Chris
Greg Bowser wrote: In MySQL, both OR and || are valid logical or operators. You can only have one Where clause, thus your last example is correct. Though in postgresql and db2 (and some other dbs) || means concatenate so stick with using the word OR in this situation otherwise you'll run

Re: [PHP-DB] SELECT query with multiple WHERE Clause

2008-02-27 Thread Daniel Brown
On Wed, Feb 27, 2008 at 6:44 PM, Nasreen Laghari [EMAIL PROTECTED] wrote: I am creating a SEARCH, by only using one table. The search form is same as Inserting item (search has form of all fields in table ), difference is SEARCH page doesnt have validation . Therefore user can enter

Re: [PHP-DB] SELECT query with multiple WHERE Clause

2008-02-27 Thread Stut
On 27 Feb 2008, at 23:44, Nasreen Laghari wrote: Thank you for increasing my knowledge about PHP/MYSQL. The question you ask below is basic SQL syntax. Please read the MySQL manual before asking here - answers at this level are all in there. http://mysql.com/doc Oh, and once you have it

Re: [PHP-DB] SELECT query with multiple WHERE Clause

2008-02-27 Thread Stephen Johnson
$query = mysql_query(SELECT * from gig WHERE gigName='$gig_name' or gig_fdate='$sdate'); You can not use more then one WHERE in your sql statement... And SQL accepts OR and AND.. -- Stephen Johnson c | eh The Lone Coder http://www.thelonecoder.com continuing the struggle against bad code

Re: [PHP-DB] SELECT query with multiple WHERE Clause

2008-02-27 Thread TG
$query = mysql_query(SELECT * FROM gig WHERE gigName='$gig_name' OR gig_fdate='$sdate'); You only use the WHERE clause once then use parenthesis, AND and OR to create the logical conditions. If you have access to the mysql server, maybe through phpMyAdmin or something, I'd highly recommend