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

Filtering an Array Based on Value
I have a very simple script set up that pulls data from a database and is output using this code:

extract a file from zip file
hi,
i know how to unzip a zip file in php, but is there a way to just extract a certain file only

Tracking Unique Clicks
Hi guys and gals,

Basically I have a database which tracks clicks on my outbound links, I do

selectbox+database connection retrive problem
Code: [Select]
<tr>
<th align="left" scope="c

present value of sequence?
Hi

Please help me to find out the present value of sequence?

Thanks

paginate search result
Hi, I have a paginations script to display data from my database but i would like to paginate someon

word wrap in emails help needed
Hello, I understand how wordwrap works in php and have used it well before. However when I used wor

Shuffle Array
Hi,

I am writing a script for a game that needs players to randomly be assigned a target (ano

A problem with my GD class
Hello,

I created a nice (and simple for now) GD class.
The problem is , it works great on

Can I use a loop
Hi buddies!

Once again with my doubts here.

Right now I am using this sql stat

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