I have an insert script with mySQL. I need to place the date and time when the record is created in the \'add_time\" column.
Can anyone show me how to modify my existin
You got the "add_time" column set up in your database? Is it of DATETIME format?
In that case you may just modify your query like this:
$order = "INSERT INTO cartons_added (type, part_no, add_type, add_qty,
add_ref, add_by, add_notes, add_time)
VALUES
('$_POST[type]',
'$_POST[part_no]',
'$_POST[add_type]',
'$_POST[add_qty]',
'$_POST[add_ref]',
'$_POST[add_by]',
'$_POST[add_notes]',
NOW())";
Though you should be aware that executing queries like this is dangerous as you trust the user to input only nice things! Google "SQL Injection" to find out more about it, mysql_real_escape_string(), too.