KAZ> Hi
KAZ> I've got a question on how to exclude a data from a query. Suppose I
KAZ> have
KAZ> the following query that is being used in combination with a PHP web
KAZ> site:
KAZ> "SELECT * FROM activities WHERE month='$month' AND year='$year'"
KAZ> Now suppose the activities table looks like this:
KAZ> ID username month day year
KAZ> 1 myuen Jan 01 2001
KAZ> 2 puffy May 27 2001
KAZ> 3 jlo June 5 2001
KAZ> How do I modify the above query so it SELECTS everything EXCEPT myuen
KAZ> (that
KAZ> is, I want my result to be puffy and jlo).
"SELECT * FROM activities WHERE month='$month' AND year='$year' AND
username!='myuen'"
--
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
| Ilya Martynov (http://martynov.org/) |
| GnuPG 1024D/323BDEE6 D7F7 561E 4C1D 8A15 8E80 E4AE BE1A 53EB 323B DEE6 |
| AGAVA Software Company (http://www.agava.com/) |
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
---------------------------------------------------------------------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)
To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php