RE: [PHP] how do i determine what posting is new??

From: Date: Wed, 29 Nov 2000 05:42:38 +0000
Subject: RE: [PHP] how do i determine what posting is new??
Groups: php.general 
Request: Send a blank email to php-general+get-27776@lists.php.net to get a copy of this message
Reply ... sorry ... \ I am wrote that on fly: here... function yesterday($fromDb) { if ((time()-84600) < $fromDb) return '[new]'; } guess this is right ... never tested it ... -----Original Message----- From: Maxim Maletsky Sent: Wednesday, November 29, 2000 2:34 PM To: 'Sandeep Hundal'; php-general@lists.php.net Subject: RE: [PHP] how do i determine what posting is new?? I guess that it is not hard at all. function yesterday($fromDb) { if (time() > $fromDb+84600) return '[new]'; } then in the script: echo "$record['name']"; echo yesterday($record['time']); 2: your way is ok, I thikn it should work ... Cheers, Maxim Maletsky -----Original Message----- From: Sandeep Hundal [mailto:sandeep_wde@yahoo.com] Sent: Wednesday, November 29, 2000 1:23 PM To: php-general@lists.php.net Subject: [PHP] how do i determine what posting is new?? Hi list, I'm making a kind of a message board for which i need to have a [new] against the ones which posted in the last day. I put $time into the database, as a unix timestamp. all i need is a function which returns a variable. So if $time (after querying it out of mysql) - 84600 * 1 is is leser than current time, it prints out [new]. also, how do i only query out of the database stuff posted in the last 14 days?? is it: $limit = $time - 1209600 (84600 * 14). query = "select * from table where time > limit"; or something??? any help would be nice! Thanks!!! Sandeep __________________________________________________ Do You Yahoo!? Yahoo! Shopping - Thousands of Stores. Millions of Products. http://shopping.yahoo.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net For additional commands, e-mail: php-general-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net For additional commands, e-mail: php-general-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net

« previous php.general (#27776) next »