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

Multithreading design
Hi

I have come up with a Singleton class that manages a pool of database connections. Basical

PHP hyperlinks generator - HELP plz
Hi

I need some help to get this done using php:


1 - I have few hyperlinks say 500

Creating an invoice
Using fpdf I am trying to create an invoice to send to clients. The products are sold in pricing tie

couldn't connect to your database
Hello I am new to php mysql

Actually i have read A tutorial on nettuts
"http://net.tu

What's wrong with my code
sobbing for many days, still don't know why please Help. Why my page isn't posted correctly. In a

If statement help please.
Hello on my site I have 2 content boxes. 1 is for the main content (which is the biggest one) and th

Reg Ex
Im trying to search for the string: srv_9 (Dead ???)

I thought to use preg_match, however I d

Online Event Ticket Sales
Has anyone wrote a script for online tickets sales?

I have been googling and found lots of th

Filtering Tables
Hello Thanks for any help any one can give Im very new to PHP..

I need to pull data for clien

my two tables
table1 : col1 = topicid , col2 = topic

table2 : col1 = sentid, col2 = sentence

Cod

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