Change snippet to use CURDATE


Posted on 16th Feb 2014 07:03 pm by admin

I am using time() in the snippet below, I would like to use CURDATE() and have the database setup for date. My problem is, I am not sure how to change the PHP coding, I keep getting errors just adding CURDATE() where time() is. Any help would be greatly appreciated...


$update = mysql_query("UPDATE comments SET comment='".$comment."',created_at='".time()."' WHERE user_id=".$_SESSION['logged_id']);
Did you know?Explore Trending and Topic pages for more stories like this.

} else {

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

Your Answer:

Login to answer
155 Like 19 Dislike
Previous forums Next forums
Other forums

True way to see if action was successful?
If this is a good way to see if action was successful to continue:

Code: function changeGa

DBCA Templates
Hi all,

I'm working on creating a template for DBCA, but can't find any documentation on the

DateTimeZone::listIdentifiers headache
http://php.net/manual/en/datetimezone.listidentifiers.php


So the documentation states tha

using variables in another page
I have a test database set up on localhost. I have a form that I can type a name into, hit the butto

Dynamic memory problem
Hey,

At the beginning of my code, I have this line:

Shape* gShape = 0;

Session is not saving
I am not trying to do anything too fancy, I am just trying to get some $_SESSION data to save and us

Echoing ASCII code
I have a php page that splits a string into chars and then echoes the ASCII code for each char. I'm

Multiple arrays inside data
Hi,

Simple question. I have a column called "array" in my database, and inserted in

Log $_POST
How would i log submits on a form, by everyone? I want to then echo the number of submissions.

Problem with "dynamic" index page
Hi. I have one question. In my index.php page I have this kind of code:
Code: // listaa sivut

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash