Save date and time in the database

0

I would like to know if I have save the date and time of my system to be able to save in the database, I would not like to create a "created_em" and add the time in the database, what I want to do is " complex "I think, I'm trying here but I did not succeed.

What I want to save

$emailarquivo = $_POST['email'].$_POST['datetime'];
$nome_final = $emailarquivo;   

How do I enter the bank

$query = "INSERT INTO contato ('nome','caminho') VALUES ('".$nome_final."', '".$_UP['pasta']."')";

I've already tried the name in place of datetime and it works, it sends the name and email in the same column, but how would you move the date and time?

    
asked by anonymous 24.08.2017 / 21:13

1 answer

0

Solution :

Change

$emailarquivo = $_POST['email'].$_POST['datetime'];

For

$emailarquivo = $_POST['email'].$date = date('Y-m-d H:i:s');
    
24.08.2017 / 21:35