Help me : Where And Or
What do you mean? Are you having any problems?
WHERE condition1 AND condition2 OR condition3
WHERE condition1 AND condition2 OR condition3
Code: Select all
define('I_LOVE_PHP', true);
He might mean criteria, perhaps is what you want?
Code: Select all
SELECT * FROM myTable WHERE user = '$uid' AND password = '$pwd' AND email = '$email'
Webmaster Yoda: You must confront the cPanel. Then, and only then, a webmaster will you be.
Julius Caesar: Veni, vidi, posti
-
- Posts: 1246
- Joined: Wed Feb 16, 2005 6:59 am
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.
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.
Reached 5000 Credits! The highest of any member on Smokyhosts! New milestone for Me!
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 possiblemohumben wrote:What do you mean? Are you having any problems?
WHERE condition1 AND condition2 OR condition3
Code: Select all
where [B]([/B]cond1 AND cond2[B])[/B] OR cond3
Code: Select all
where cond1 AND [B]([/B]cond2 OR cond3[B])[/B]