mysql select where problem
| From: | Matt Nigh | Date: | Sun, 26 Aug 2001 23:09:08 +0000 |
| Subject: | mysql select where problem | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-11844@lists.php.net to get a copy of this message | ||
hello again,
i'm stuck with this mysql query and can't seem to get it right
// start code
$result = mysql_query("select * from shows WHERE date >= '" . $year ..
"-" . $month . "-" . ("00") ."' AND where date <=
'" . $year . "-" . $month . "-" . ("31")
."'");
// end code
and yes, $year and $month are both defined earlier in the code.
essentially what i want to do is have the 'date' field be equal or greater than ****-**-00
(ex. 2001-08-00) and equal or less than ****-**-31 (ex. 2001-08-31). i need this so that it selects
only the given records within that given month.
if anyone can help or at least point me in the right direction, i'd really appreciate it.
i've looked at the mysql docs and haven't found anything for what i'm looking for.
thanks in advance,
Matt