For the life of me I can't get the current date to insert into my table. I would like a "submitted date" to be stored upon the creation of the record. I've tried countless different ways to achieve this and every time I get no results in the table, just the default 0000-00-00 (it's set to date). Being completely new to this I'm positive I'm doing some completely wrong, I just can't figure out what.

// Insert fields into XINFO 
	$sql = "INSERT INTO xinfo SET
date_submit='$dsub',    //<--  set to $dsub = 'CURDATE()';

// execute query
    $result = mysql_query($sql);

I think you'll find that the example at this page will shed light on the problem.

Just from a glance, and not being set up to test it, I'd say to change date_submit='$dsub' to date_submit=CURDATE() .

Thanks jcacquiescent27,
Perhaps I simply needed to slow down a bit and walk myself through it. Oddly enough CUREDATE() works if I change my syntax to

// Insert fields into XINFO 
	 $sql = "INSERT INTO xinfo (date_submit) VALUE (CURDATE())";

Instead of the way I had it

date_submit = CURDATE();

would not work

This question has already been answered. Start a new discussion instead.