Jump to content

Help switching to DATE format


codeboy89

Recommended Posts

I am currently using time() in the created_at entries, I would like to use CURDATE, but cannot get it to work. can anyone please fix this snippet.

 

 

        $update = mysql_query("UPDATE comments SET comment='".$comment."',created_at='".time()."' WHERE user_id=".$_SESSION['logged_id']);

 

      } else {

 

        $insert = mysql_query("INSERT INTO comments(`id`,`user_id`,`comment`,`created_at`) VALUES(0,".$_SESSION['logged_id'].",'".$comment."','".time()."')");

Link to comment
https://forums.phpfreaks.com/topic/179430-help-switching-to-date-format/
Share on other sites


         $update = mysql_query("UPDATE comments SET comment='".$comment."' WHERE user_id=".$_SESSION['logged_id']);

      } else {

         $insert = mysql_query("INSERT INTO comments(`id`,`user_id`,`comment`) VALUES(0,".$_SESSION['logged_id'].",'".$comment."')");

 

 


         $update = mysql_query("UPDATE comments SET comment='".$comment."' WHERE user_id=".$_SESSION['logged_id']);

      } else {

         $insert = mysql_query("INSERT INTO comments(`id`,`user_id`,`comment`) VALUES(0,".$_SESSION['logged_id'].",'".$comment."')");

 

how will that work?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.