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

Shuffle between users ??
I have multiple $users in table. I need to send them $message.

I need to send the next messag

PHP code for a proxy
I was wondering which function I could use to create an online proxy tool. I was thinking cURL would

Deleting pointers froms vector?
Hi. I have a vector filled with pointers and I want to delete the pointers. I could do a loop and do

ImageCreate()
When I create an image and add text to it I want my text to be replaced with a PNG image, because th

How to restrict the display of report variants
Hello All,

I want t know how to restrict the display of report variants.
I mean, whe

Help with Hyperlink
Hi,

What I am trying to do may be simple, I just can't get it to work. Ok...

I am usin

Something Non-Traditional. Can we solve?
I have an idea for an application here. It's mostly flash, but it couldn't work without a somewhat n

updating a single value to multiple non consecutive rows
I need to update the same value to multiple non consecutive rows. I need to add an experation date t

gather checkbox data from form into email
Hello all,

First, i'd like to thank everyone who responded to my previous posts regarding set

Need help making login verification cleaner...
I use the below to verify user login. I first check the cookie for the id, ip and a unique id. If it

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