Re: Between Query (0T)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



<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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux