Page 1 of 1

Help me : Where And Or

Posted: Fri Oct 13, 2006 4:10 am
by Mcbollard
just wondering, when using 3+ criterater, how sql handles it

Posted: Wed Oct 18, 2006 4:55 am
by mohumben
What do you mean? Are you having any problems?

WHERE condition1 AND condition2 OR condition3

Posted: Sat Dec 23, 2006 11:52 am
by vinter
wtf does criterator mean?

Posted: Fri Dec 07, 2007 5:11 pm
by csoftdev
ask your question properly will be very helpful.
if you mean 3 conditions, then just use AND/OR to link up those conditions.

Posted: Tue Dec 11, 2007 2:51 am
by Tails5
He might mean criteria, perhaps

Code: Select all

SELECT * FROM myTable WHERE user = '$uid' AND password = '$pwd' AND email = '$email'
is what you want?

Posted: Tue Dec 11, 2007 5:13 am
by TheCrymsonLegends
That may be it but I think he wants to have it explained as how it works between mySQL and the php code.

If you are right Tails I would assume it means in order to get a query from the sql database you must match multiple parts from it. Such as a log-in page you would have to have your username, a password, and sometimes an image. If any three of them are incorrect then you will fail to query the sql database successfully to continue with the script. Normally from single criteria you would input something and it would query back anything from that table/section of the database. Such as a search engine.

Hope that is what you wanted, and thanks Tails you helped me with that line of code too lol.

Posted: Sun Dec 16, 2007 1:34 pm
by Lixas
mohumben wrote:What do you mean? Are you having any problems?

WHERE condition1 AND condition2 OR condition3
i dont realy know which keyword AND or OR has priority, so i dont realy know how sql engine will handle this query. Could be possible

Code: Select all

where [B]([/B]cond1 AND cond2[B])[/B] OR cond3
or

Code: Select all

where cond1 AND [B]([/B]cond2 OR cond3[B])[/B]
maybe someone could tell me exactly how "and" "or" are interpreted together in one query

Posted: Tue Jan 29, 2008 5:24 am
by Tails5
I think that AND has a higher priority than OR, but I'm not exactly sure.

sql

Posted: Wed Jan 30, 2008 11:12 pm
by Gebbo
whats criterater :S lol its very hard to understand what your saying if your words are not accurate anyways sorry i couldnt help.