CodeCharge Studio
search Register Login  

Visual Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> Archive -> GotoCode Archive

 Custom SQL -> Timestamp

Print topic Send  topic

Author Message
Sebastian
Posted: 10/04/2002, 10:41 AM

Please help im in trouble :-)

i want to use my own mysql string to become my data from the mysql table. with this string i want to become some date sorted. this is my string:
SELECT title, term_id, datum FROM term_story WHERE datum/86400>=1033750338/86400

asume that the 1033750338 is the actual unix timestamp. what i need is, to pass automaticly the actual Unix timestamp in place of 1033750338. i have tried to use this:

SELECT title, term_id, datum FROM term_story WHERE datum/86400>=time()/86400, but his produces a MySQL error.

Is there a solution ? Please help as fast as you can. Many thanks ..
Nicole
Posted: 10/07/2002, 6:35 AM

Sebastian,
in case you're using PHP you can include php time() function inside the query, e.g.:
$sql = "SELECT title, term_id, datum FROM term_story WHERE datum/86400>=".time()."/86400";

   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

PHP Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.