Fix quote function to correctly interpret NULL values (insert, update)

When inserting an array of datas which have some keys not set to a value, the quote function intepret it as '' instead of NULL. And when the target field is an integer in db, the result stored is 0