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

Checking if multidimensional array is empty?
I have a for with multiple test input fields. Specifically the user submits multiple names and ages

Batch update record with Pagination
Hoping someone can help me with this issue I'm having, im trying to batch update records from a resu

Odd or Even
Inside of a while loop I need to echo several rows of info...easy enough.

In the loop (for th

A little help in c#
i am doing a simple paint program using c# i want to draw with the mouse so i wrote the code of the

PHP Include not working
The website is http://www.grlistingservices.com

The code block is as follows:

<

button help
i originally had this but realised it is much easier to have a button.

Code: <?php

this code is not working????
it says this error.. Warning: Division by zero in ..

the variables are correct, so why is th

Code Help.. If txt input box empty search X instead..
I am having a problem with my search script. At current it will simply search by a selected date whi

Date help - fetch dates for Mondays between xxx and yyy?
Does anyone know the best way to do this? I have two dates, say:

2010-01-26 and 2010-05-30

Displaying different page content, depending on the logged in user.
Hi all, I am new to ASP.net (and web development in general), and have a question about how I can di

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