Page 1 of 1

How can I specify to fetch all rows with at least one matchi

Posted: Fri Sep 02, 2011 4:23 am
by aneuryzma
How can I specify to fetch all rows with at least one matching field ?

Code: Select all

$result = mysql_query("SELECT * FROM Users WHERE Field1 = 'value1' or Field2= 'value2'  ");
Thanks

Re: How can I specify to fetch all rows with at least one ma

Posted: Fri Sep 02, 2011 7:52 am
by Eric!
It seems you answered your own question. Did that not work?

Re: How can I specify to fetch all rows with at least one ma

Posted: Fri Sep 02, 2011 10:13 am
by genix2011
Hi,

at least one? if there is nothing matching your condition, then there can't be anything returned by mysql.

if you want to limit your result to one row, that is possible with the LIMIT keyword.

Greets.