hello,
thank you for your time.
please note the time "intervals" that are working. what i
want is to select only data that is two weeks old or younger. i did a
test with one day and it worked great. i inserted the two-week/14days
and neither of them worked. 1 month worked. i could not find anything
on php.net that directed me to this. thank you again, addison
this works:(*note end of syntax "interval 1 day")
$obj = mysql_db_query($dbname,"select a.*,s.name as
subcategory_name,c.name as category_name from ads a,subcategory s,
category c where a.subcategory=s.id and s.category=c.id and
a.subcategory=$id and a.que='checked' and
createdate >=subdate(now(), interval 1 day)");
this does not: (*note end of syntax "interval 14 days")
$obj = mysql_db_query($dbname,"select a.*,s.name as
subcategory_name,c.name as category_name from ads a,subcategory s,
category c where a.subcategory=s.id and s.category=c.id and
a.subcategory=$id and a.que='checked' and
createdate >=subdate(now(), interval 14 days)");
this does not: (*note end of syntax "interval 2 weeks")
$obj = mysql_db_query($dbname,"select a.*,s.name as
subcategory_name,c.name as category_name from ads a,subcategory s,
category c where a.subcategory=s.id and s.category=c.id and
a.subcategory=$id and a.que='checked' and
createdate >=subdate(now(), interval 2 weeks)");
this works: (*note end of syntax "interval 1 month")
$obj = mysql_db_query($dbname,"select a.*,s.name as
subcategory_name,c.name as category_name from ads a,subcategory s,
category c where a.subcategory=s.id and s.category=c.id and
a.subcategory=$id and a.que='checked' and
createdate >=subdate(now(), interval 1 month)");
--
Addison Ellis
small independent publishing co.
114 B 29th Avenue North
Nashville, TN 37203
(615) 321-1791
[EMAIL PROTECTED]
[EMAIL PROTECTED]
subsidiaries of small independent publishing co.
[EMAIL PROTECTED]
[EMAIL PROTECTED]
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
- RE: [PHP-DB] subdate Addison Ellis
- RE: [PHP-DB] subdate John W. Holmes
- [PHP-DB] Time entry program Marie Osypian