0

HI,
I am trying to insert the current date into mysql when a user submits their info. I cant use timestamp for this one. I am using datetime. It works when a user updates but not for creating. I get all 0's in the date column.
Here is the code for the date part only.

$insertSQL = sprintf("INSERT INTO user (date) VALUES (%s)"
GetSQLValueString($_POST['date'], "defined",
					GetSQLValueString($_POST['date'],"date"),'NOW()'));

<input name="date" type="hidden" id="date" value="NOW()" />
1
Contributor
1
Reply
3
Views
7 Years
Discussion Span
Last Post by phpDave
0

Got it! If anyone is interested:
I changed it to

GetSQLValueString($_POST['date'], "defined", 'NOW()'));

Works now.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.