How to set zero values ​​when importing into phpmyadmin?

I am trying to import a CSV file into phpmyadmin where several fields are purposefully left blank. I need this field to register as null values, and not just as an empty string.

I know that in the properties of the field you can choose to allow "null" or "not null" for each field, but when importing it still does not change the cell to zero. After import, I can manually go to the zero field for each field on each record, but this is unrealistic, given the amount of data I work with.

Is there any way to get phpmyadmin to set these empty cells to zero when importing?

+3
source share
3 answers

.

CSV PhpMyAdmin NULL, , NULL . , :

"1", "2" ; NULL; NULL

"2" , "2" ; NULL; NULL

.

, CSV - Open Office Calc, , NULL, :

"1", "2" , "NULL" ; "NULL"

"2" , "2" , "NULL" ; "NULL"

.

, [ "NULL" = NULL].

, () , :

[, =, NULL,]

, , NULL :

[,\n =, NULL\n]

+5

, jmbertucci . .

"hello","world",,,,,,

, , [, =, NULL], jmbertucci , .

"hello","world",NULL,,NULL,,NULL

, 0

0

, , MySQL noob, , .

find/replace rigamarole jmbertucci , CSV, , . phpMyAdmin, "" , replace NULL with:, - NULL. "NULL", .

0

Source: https://habr.com/ru/post/1785075/


All Articles