Incorrect integer value: '' for column 'downlineuserid' at row 1

I’m fixing some legacy code.

The error message

#1366 - Incorrect integer value: ‘’ for column ‘downlineuserid’ at row 1

How do I fix this problem without having to check that variable downlineuserid has a value and setting it as 0.
I would have to do this thousands of times on every int and float. There must be a method that does not involves slowing down PHP with thousands of lines like this
if($_POST[‘downlineuserid’] == “”) { $_POST[‘downlineuserid’] = 0; }

FAILING SQL: insert into 01matrixincome ( depositid , threadid , uplineuserid , downlineuserid , startuserid , matrixlevel , publicbookid , publicticketid, domain , matrixincome , matrixcurrency , incometype , incomenote , paid , createdate, createdateshort ) VALUE ( ‘868’, ‘threadid’ , ‘1’ , ‘’ , ‘’ , ‘’ , ‘’ , ‘’, ‘’ , ‘1’ , ‘USD’ , ‘paymentaccount’ , ‘paymentaccount from user #1 payment from User #1’ , ‘’ , NOW(), NOW() );

Table 01matrixincome

incomeid bigint(20) NO PRI NULL auto_increment
depositid bigint(20) YES NULL
threadid varchar(16) YES NULL
uplineuserid bigint(20) YES NULL
downlineuserid bigint(20) YES NULL
startuserid bigint(20) YES NULL
matrixlevel bigint(20) YES NULL
publicbookid varchar(20) YES NULL
publicticketid varchar(20) YES NULL
commentid bigint(20) YES NULL
paymentlevel int(11) YES NULL
adid bigint(20) YES NULL
originalbookid varchar(20) YES MUL NULL
publiccheckid varchar(20) YES NULL
domain varchar(100) YES NULL
matrixincome decimal(10,0) YES NULL
matrixcurrency varchar(3) NO USD
incometype varchar(32) YES NULL
incomenote varchar(200) YES NULL
paid varchar(3) YES NULL
createdate datetime YES NULL
createdateshort date YES NULL
transactionid varchar(64) YES NULL

2 posts were merged into an existing topic: Since a Mariadb update, every field in my databases requires a default value