I am trying to insert some data by php into my database, when making the INSERT I get the following error:
Error de MySQL : 1411 : Incorrect datetime value: '21/09/2018' for function
str_to_date.
I leave the insertion code:
$SQL = "INSERT INTO control_gasolio.registros
(nombre,proveedor_gasolio,tipo_gasolio,litros,euros,numero_tarjeta,fecha)
values
('$nombre','$proveedor','$gasoleo','$litros','$euros','$tarjeta',STR_TO_DATE(
'$fecha', '%d-%m-%Y' ))";
I would appreciate some help in knowing what my mistake may be. Thanks