Inserting a Date and Time value to a MySql from PHP
        Posted  
        
            by DomingoSL
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by DomingoSL
        
        
        
        Published on 2010-06-01T03:54:34Z
        Indexed on 
            2010/06/01
            4:03 UTC
        
        
        Read the original article
        Hit count: 214
        
Hello i want to send to a MySQL data base a date and time in a format compatible with the mysql DateTime format, wich is: 0000-00-00 00:00:00 ...
Im using this code who brings the date and time from a PHP command:
   $insert = "INSERT INTO sms (ref, texto, fecha)
   VALUES ('".$_POST['usuario']."', '".$_POST['sms']."', '".date(DATE_ATOM, mktime(0, 0, 0, 7, 1, 2000))."')";
   $add_member = mysql_query($insert);
I really want to do this but with a MySQL command, i mean, using the Date and Time from the mysql server. Thanks
© Stack Overflow or respective owner