[PHP] Querying MySQL using 'AND' / 'OR'

2001-02-03 Thread James, Yz
Hi Guys, Quick question.. I've managed to write a function (thanks to help from people earlier in the week) which queries an admin table. There are currently four fields in the table; id, username, password, and 'site', where the 'site' means a subdirectory of my site that the particular a

Re: [PHP] Querying MySQL using 'AND' / 'OR'

2001-02-03 Thread Christian Reiniger
On Saturday 03 February 2001 15:02, James, Yz wrote: > $sql = "SELECT * FROM table > WHERE username = '$username' AND password = '$password' AND > site = 'theirsite' OR site = 'all'"; > So, without writing some if statements, is there any way of rewriting > that $sql check so that it che