SQL statement are:

> What is proper way to define a variable to include all dates newer than
> 1995-01-01?
> $query = "???"

select * from table where date > '1995-01-01'

> What is proper way to define a variable to include all dates older than
> 1995-01-01?
> $query = "???"

select * from table where date < '1995-01-01'


> What is proper way to define a variable to include all  dates between
> 1995-01-01 and 1998-12-31?
> $query = "???"

select * from table where date < '1998-12-31' and date > '1995-01-01'

Regards,
Dan

> -----Original Message-----
> From: Craig Westerman [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, 26 February 2002 12:18 p.m.
> To: MySQL List
> Subject: MySQL php - assigning date variables
>
>
> $query = ""
> mysql_query("SELECT * FROM table WHERE date LIKE '%". $query ."%'");
> // returns all items in database
>
>
> $query = "2001-01-01"
> mysql_query("SELECT * FROM table WHERE date LIKE '%". $query ."%'");
> // returns all rows that have 2001-01-01 as the date
>
>
> What is proper way to define a variable to include all dates newer than
> 1995-01-01?
> $query = "???"
>
> What is proper way to define a variable to include all dates older than
> 1995-01-01?
> $query = "???"
>
> What is proper way to define a variable to include all  dates between
> 1995-01-01 and 1998-12-31?
> $query = "???"
>
>
> Everything I tried gives me an error. This has to be simple, but I must be
> overlooking something. Where would I find the answer?
>
> Thanks
>
> Craig ><>
> [EMAIL PROTECTED]
>
> ---------------------------------------------------------------------
> 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
>
>


---------------------------------------------------------------------
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

Reply via email to