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']);

} 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

Apart from cron
I need to run a php file every one hour. Is there any other solution apart from cron job?

gmmktime or mktime
I live in the UK, i am within the GMT (with daylight saving time ie 1 hour difrence between summer a

convert static html data into dynamic
hi all

i need to convert a website which has static above 2000 articles into dynamic and add

Connect to database that isn't localhost
I am currently doing a small script for a company that doesn't have mySql support on there hosting.

Server side $_SESSION
how does one keep the session completely server side. no cookies to the browser at all. i need this

UTL File problem
Hi
I have a file in certain path with the following permissions (The file is a dummy file witho

sapgui f4 help last search
I know this has to be simople. One user (maybe more) does not have the "last search saved" from the

upload photo limits
ive got a upload photo script and im just trying to make more secure currently it limits size and as

Polymorphism
Was wondering if someone could explain this a little better to me. I had always assumed that it had

Paypal
Hi all,

I have an advanced basic knowledge of php

I want to try something new for a s

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