How can I insert the value from an (in a form) into a MySQL date field. I'm trying this:
<form action="enviar.php" autocomplete="off" method="post">
<label for="nacimiento" class="youpasswd" data-icon="p">
Fecha de Nacimiento
</label>
<br>
<input id="nacimiento" name="nacimiento"
required type="datetime" placeholder="DD/MM/YYYY" />
</form>
enviar.php
$nacimiento= $_POST['nacimiento'];
mysql_query("INSERT INTO voluntarios(nacimiento) VALUES ('$nacimiento')");`
This is working for all the other fields but not with the date field; it is empty. What am I doing wrong?
Thank you
$nacimiento = mysql_real_escape_string($_POST['nacimiento']);mysql_instead ofmysqli_. UseMySQLiandmysqli_query($conn, "INSERT INTO voluntarios(nacimiento) VALUES ('" . mysqli_real_escape_string($nacimiento) . "')");