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

Linkage between two scripts
Okay say I have this for a link in a script:

Code: <li><a href="#&q

extending tidy
I have problem with type-hinting and extending tidy. This code creates error:
Code: class cMyTidy

Looping Problem
I've got a client that has a database with about 200 events at any given time. I'm trying to loop t

Export hangs
Hi all, please help

I have a Oracle 10.2.0.3.0 database. When I want to query the dba_segmen

$variable = $variable
Hello

Sorry if this is a really simple question but I have run out of ideas. Is there a reall

Weird MySQL error, why am I recieving this?
PHP Code:


<?php require "global_settings.php"; ?>
<titl

Php Mysql Page Loading Notice
Hi all,

I was wondering if there is a way (Sure there is) of showing a message or an image wh

OOP help
okay so i have a class im making it has everything setup i just need to randomize the 2 variables an

Display a default image
I am trying to display generic image for items that don't have one, but I can't get it to display.

switch not getting value
what am i doing wrong?
i want to populate the country list according to the category
i want to

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