[snip]
$sql = "Select tblchatglobal.cgid, tblchatglobal.cgdateposted, 
tblchatglobal.cgtimeposted, tblchatglobal.uid, tblchatglobal.cgmsg, 
tblusers.uid, tblusers.uusername from tblchatglobal, tblusers where 
(tblchatglobal.uid = tblusers.uid) and (DATE_SUB(CURDATE(),INTERVAL 1
HOUR) 
<=  tblchatglobal.cgtimeposted) order by tblchatglobal.cgtimeposted
desc";
[/snip]

One of the MySQL lists will be really helpful to you.
http://dev.mysql.com/doc/mysql/en/date-and-time-functions.html

AND (DATE_SUB(CURDATE(),INTERVAL 1 HOUR)<=  tblchatglobal.cgtimeposted)

CURDATE is wrong here, as it only returns a date. NOW() returns a
datetime. Try....

AND (DATE_SUB(NOW(),INTERVAL 1 HOUR)<=  tblchatglobal.cgtimeposted)

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to