mySQL PHP adding current time to table to my code?

CHACHITO

New member
Hi everyone, so am having a little trouble here, i had the following working line of code in php and mySQl:
-------------------------------------------
$query = "INSERT INTO analyses (analysis, username, success, series, plates, replicates) SELECT '$tmpdir', 'unknown', 0, series, plates, replicates FROM analyses WHERE analysis = '".$_GET['dir']."'";

mysql_query($query) or die(mysql_error());
---------------------------------------
now i added a "datestamp" column to my analyses table in my Sql database at the end, with data type : "DATETIME".
I want to be able to store in my database the current date/time of the execution of that line in format: YYYY-MM-DD HH:MM:SS (time zone doesnt matter bcos i only need it to sort the table by "last modified" later...)
----------------------------------------
So can anyone tell me how to fix my code to add the current time to the table? (i read about using the NOW() function bcos it has same format as DATETIME datatype.... however im not sure where to insert it if thats the case...help soon plz? thanks in advance.)

Also, anyone knows AFTER i make that current date thing, how i can sort my query based on DECREASING Datestamp order? (i.e lists by last modified and backwards in time?)
 
Back
Top