How to insert NULL value into the database with csv import or bulkedit?

QuestionsHow to insert NULL value into the database with csv import or bulkedit?
Alexander Toth asked 6 years ago

Hello,
I’ve a column with the option $col[“isnull”] = true;
In default edit mode this works fine, if I put 0 in the dialog box the NULL value is inserted into the database.
But unfortunately this not works in bulkedit mode and with the csv import function. With the csv import function the value 0 is inserted into the database (I also tried to put NULL in the csv, but the result is that in the database is written the text NULL and not the NULL value)
In bulkedit instead if I put 0, this is totally ignored a there are no changes.
There is any solution or workaround? Thanks

 

5 Answers
Abu Ghufran Staff answered 6 years ago

Both issues are resolved and updated files emailed to you.

_________________________
Abu Ghufran - Dev Team
Grid 4 PHP Framework
 
Alexander Toth answered 6 years ago

Hello Abu,
I tested your fix, it works well for bulkedit but not for csv import.
The fields with isnull options are recognized correctly but there is some problem with the insert query
I checked the mysql log and the query is like:

INSERT INTO test (field1,field2,field3) VALUES (”,’10’,’2019-02-10′)

When it should be

INSERT INTO test (field1,field2,field3) VALUES (null,’10’,’2019-02-10′)

Thanks

Abu Ghufran Staff answered 6 years ago

Make sure you update step3.php in lib/inc/import. I verified it before sending. Please confirm.

_________________________
Abu Ghufran - Dev Team
Grid 4 PHP Framework
 
Alexander Toth answered 6 years ago

Yes, I confirm that the file is updated.

Abu Ghufran Staff answered 6 years ago

Emailed you update that should fix import case.

_________________________
Abu Ghufran - Dev Team
Grid 4 PHP Framework
 
Your Answer

6 + 8 =

Login with your Social Id:

OR, enter

Attach code here and paste link in question.
Attach screenshot here and paste link in question.



How useful was this discussion?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate it.

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?