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

PHP/Database issue
My friend is helping me make a database where you go to a certain webpage of my site and the page wi

Unique Visitor Tracking
Hello. Currently, I run a voting site where voters are tracked by their IP address and can only vote

Need help in log in and log out?
hi there all of u. i have recently created a site for someone. i have placed log in and log out and

start new row of pictures
on my site www.budstreasureauctions.com there is a featured auctions box that users will pay to get

Random Number Generation And Probability
Hello, I am working on a function which has to insert data into a SQL table.

we have to suppl

login box shows up again after logging in 2nd login works
Hello,

I am having trouble on my site Lockerz.rack111.com where when you login the login box

building a function with multiple outputs
I want to build a function that has multiple outputs.

I know but am not to sure how I should

Run function every 5 mins ??
I have a function PostMessage()

How can I run it every 5 mins ??

simple php table loop
Hi all,

I've the following code

<?php // Create category options

array_map() probably obvious mistake
The code below is part of a class to escape strings, but should also accept an array, using array_ma

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