Inserting the current date/time while submitting the forum


Posted on 16th Feb 2014 07:03 pm by admin

What do I need to add below to update the current date/time? I have a field in the database called datetime. I tried to use Now() but its not working.

Code: <?php
$con = mysql_connect("host" , "aaaaa" , "pw");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}

mysql_select_db("aaaaa", $con);

mysql_query("update application set comment='".mysql_real_escape_string($_POST[comment])."' where `name`='".mysql_real_escape_string($_POST[name])."'");

/*This is what I tried to add so that i can directly inject the current date/time*/
$sql="INSERT INTO application (datetime)
VALUES(NOW())";


mysql_close($con)
?>

No comments posted yet

Your Answer:

Login to answer
210 Like 37 Dislike
Previous forums Next forums
Other forums

Buggy registration system
Hey, I just started scripting in PHP, and I ran into a few problems.
Code: <?php
includ

Using two $_POST Function / Switch () statements, second does not work.
Hi all. I’m new to php and am having a problem getting $_POST Function / switch () to work. I

matching numbers inside ( )
I know I can match numbers by just [0-9]+, so I thought matching numbers inside ( ) would be somethi

trim function issues
Hi guys, total noob here...

So I've been tinkering around with a html and am using php to em

FAGL_FC_TRANSLATION FAS52 New GL ECC 6.0
Hello,

The new program for Translating GL Balances (FAS 52) gives the option to use diffe

str_replace help
I am thinking str_replace is my only option to filter outputs from my database to convert them to sa

Needing Youtube thumb nail fix.
I have a script on a site that pulls in you-tube videos,
The problem is, that the thumb nails for

http to https
Hi,

Is there any specific method/condition to move an http:// page to https:// ?

Displaying a record from mysql in a simple swf file
Hi,

I have a mysql database containing information I would like to display in my swf.

Upload simple problem
Really confused!! I run once and it worked, but when i tried today...it didn't work

Which par

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