Hi:
I have an application which I wrote in PHP/MySQL, beginning in about 2004. It's been growing over the past 15 years. I'm not a professional coder so it's definitely home-grown, backyard code but I've been learning over the years.
It's currently running on PHP5 and I have delayed upgrading to PHP7 because of all of the "mysql" -> "mysqli" conversions that I would need to do.
That said I am now in the process of converting hundreds of pages and thousands of SQL calls to mysqli. (The code is still mostly procedural) Using functions, it's a pretty straight forward process just time-consuming.
A question I have, however is mysqli seems much more strict (and not very intuitive) about what is required for data types.
As an example, I have a table with a date field. The "type" is "date" and the default is "null". However, when I set the "$date" variable explicitly to "NULL", I get the following error:
Incorrect date value: '' for column `managernew`.`biz_devel`.`date` at row 1
If I set the "$date" variable explicitly to "0000-00-00" it works fine... but I don't really want that.
Also, where I have an "integer" field, mysql used to let me pass a '' or a NULL but now I have to explicitly see if there is a value and if not, set it to zero.
What am I missing?
Can someone point be to a resource which explains how mysql and mysqli treat data types differently?
Thanks