I am trying to insert data into a MySql
database with the query below.
$sqlQuery = "insert into abc set a='$var1', b=STR_TO_DATE('$b', '%d/%m/%Y')"
I get this error
Incorrect datetime value: '' for function
str_to_date()
How can I default both a
and b
to NULL
when the variable values are missing.