ohdang888 Posted January 21, 2008 Share Posted January 21, 2008 how do i use a now() function??? i tried the code below, but i got this error Fatal error: Call to undefined function now() what did i do wrong? $now = now(); Link to comment https://forums.phpfreaks.com/topic/87131-solved-now-function/ Share on other sites More sharing options...
teng84 Posted January 21, 2008 Share Posted January 21, 2008 now is not PHP function its is MySQL if you want to use that in your query and store in a var you have to put a " or ' around that $now = 'now()'; Link to comment https://forums.phpfreaks.com/topic/87131-solved-now-function/#findComment-445639 Share on other sites More sharing options...
ohdang888 Posted January 21, 2008 Author Share Posted January 21, 2008 do i need to put anything in the ()??? Link to comment https://forums.phpfreaks.com/topic/87131-solved-now-function/#findComment-445640 Share on other sites More sharing options...
teng84 Posted January 21, 2008 Share Posted January 21, 2008 do i need to put anything in the ()??? what? like i said this is not php function you cant use that in your script or maybe your looking for date function of php eg ..date('m-d-Y') <a href="http://dev.mysql.com/doc/refman/6.0/en/date-and-time-functions.html#function_now">now </a>is sql func once again Link to comment https://forums.phpfreaks.com/topic/87131-solved-now-function/#findComment-445645 Share on other sites More sharing options...
KrisNz Posted January 21, 2008 Share Posted January 21, 2008 As Teng mentioned, you might be looking for the date function. The php equivalent of now() is date("Y-m-d H:i:s"); Link to comment https://forums.phpfreaks.com/topic/87131-solved-now-function/#findComment-445656 Share on other sites More sharing options...
teng84 Posted January 22, 2008 Share Posted January 22, 2008 here's another one dont you think these treads are different? Link to comment https://forums.phpfreaks.com/topic/87131-solved-now-function/#findComment-445674 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.