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()" />

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

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

Works now.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.