php-general | 2005051
Date: 05/08/05
- Next message: Evert | Rooftop Solutions: "Re: [PHP] Fastest templating mechanism"
- Previous message: Richard Collyer: "Re: [PHP] Between Query (0T)"
- Next in thread: Burhan Khalid: "Re: [PHP] Between Query (0T)"
- Reply: Burhan Khalid: "Re: [PHP] Between Query (0T)"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
<clip>
Your looking at something like. For ages between 21 and 23
$Upper = date("m-d-Y", mktime(0,0,0,date("m"),date("d"),date("y")-22));
$Lower = date("m-d-Y", mktime(0,0,0,date("m"),date("d"),date("y")-23));
$sql = "SELECT field1,field2,field3 FROM `table_name` WHERE `age`
BETWEEN " . $Lower . " AND " . $Upper;
$result = myqsl_query($sql);
etc....
Cheers
Richard
</clip>
Hey Rich,
Thanks! That is EXACTLY what I was looking for and instead I got around 10
people sending me
a link to the mySql manual's BETWEEN syntax :-)
Thanks mate, it works perfectly.
Cheers,
Ryan
-- No virus found in this outgoing message. Checked by AVG Anti-Virus. Version: 7.0.308 / Virus Database: 266.11.6 - Release Date: 5/6/2005-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
- Next message: Evert | Rooftop Solutions: "Re: [PHP] Fastest templating mechanism"
- Previous message: Richard Collyer: "Re: [PHP] Between Query (0T)"
- Next in thread: Burhan Khalid: "Re: [PHP] Between Query (0T)"
- Reply: Burhan Khalid: "Re: [PHP] Between Query (0T)"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

