I have this code:
$date = '1991-08-13';
$sql = "INSERT into TABLEA
(nombre, apellido1, apellido2, direccion, codigoPostal,fechaNacimiento, notas)
VALUES
('agds', 'asdgff', 'gerth', 'dfghdfghd efdgvwr', 86486, $date, 'ShhhHH');";
My problem is the next one:
When I insert that $date's value is: 1991-13-08
but in the DB appears: 0000-00-00
I've seen other posts with solutions like: STR_TO_DATE()
and it dosen't work for me, it inserts NULL. Any other solution?
EDIT: missing: '' in $date (it should have been: '$date') Thanks for the correction! (: