Re: mysql + $_GET
| From: | Tim Nagel | Date: | Tue, 08 Apr 2003 04:27:45 +0000 |
| Subject: | Re: mysql + $_GET | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-142796@lists.php.net to get a copy of this message | ||
What you have there, is a bit strange. Your testing to see if a variable is
set, and just go ahead and set the current year and month?
($time = time();)
-Tim
----- Original Message -----
From: "Sebastian" <sebastian@dslr.net>
To: "php list" <php-general@lists.php.net>
Sent: Tuesday, April 08, 2003 2:04 PM
Subject: [PHP] mysql + $_GET
> hello, i am a little confused with this:
>
> I have a URL that looks like this: month=April&year=2003
>
> in mysql the time stamp is unix format, and i want to select rows based on
> the URL.
>
> $time = time();
> if($_GET[year]) {
> $year = date(Y, $time);
> }
> if($_GET_VARS[month]) {
> $month = date(F, $time);
> }
>
> mysql_query("SELECT * FROM news WHERE time = '???'");
>
> How do I go about this, since there are two variables, $year and $month
from
> the $_GET
>
> cheers,
> - Sebastian
>
>
>