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");
Did you know?Explore Trending and Topic pages for more stories like this.
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

Placing and array within an array then sorting it!
I have a page that runs two large mysql queries and saves the results into arrays, in php I then per

URL Rewrite issue
Im created a series of Rewrites and on page checks to make sure the correct url is being called. But

Object Interfaces
EDIT: Never mind, I just updated to php 5.

Hey all,

I'm currently experimenting with p

A rank users order by points
I want to make an insert from table 'rank' , with number (rank) from the cod blow, to fild users.ran

Where do I put CRON code
So I've figured out alot about how to automatically run a php function. I can't figure out where to

Dynamically allocating the number of rows in a table based on a variable value
Hi,
I have situation here which i cannot resolve, I have a variable temp which stores the num

Convert array to string and write to csv file
I am looking to write a MySQL query to a csv file.

At the minute I:

check for the orig

wav to mp3 + goDaddy
I need to convert wav files to mp3s. From what I have found so far one way to do it is to have my PH

Print 'a' to 'z' via for loop
A very simple problem..
How Can I print a to z NOT a to y ?
It is a part of a code where
<

ORA-00932: inconsistent datatypes: expected - got CLOB
SO : windows xp
database : XE

there is a table (transito) with two fields of clob

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