-1

Greets everyone,

I have a PHP form with 40 fields to fill in when a job is completed by a driver. Not all these fields will be filled in. My problem with the new mariaDB update is, the INSERT INTO execution fails on the blanks.

I have set all the SQL default to NULL, but if the page tries to set a "" blank, the SQL doesn't make it a NULL.

Is there anyway way, other than a conditional blank check on every field, to bypass then blanks?

Thanks

Burr
  • 1
  • 3
    Possible duplicate of [MySQL and PHP - insert NULL rather than empty string](https://stackoverflow.com/questions/4620391/mysql-and-php-insert-null-rather-than-empty-string) –  Aug 14 '18 at 13:37

1 Answers1

0

try this for your values

$a = isset($_GET['a']) ? $_GET['a'] : null;

if you are using php7.0+ then you may use Null Coalescing Operator refer

manu
  • 351
  • 2
  • 15