Jump to content

phpmyadmin not adding "NULL" to empty cells


kristinac

Recommended Posts

i am very new to MySql and this problem is driving me crazy.

 

i'm importing a CSV file into my table (with a setting of "null" default value=null). when i import the table, it doesn't automatically put "NULL" in the empty cells, so each time i import an updated spreadsheet i have to go back and manually check "null" on every line item. a very tedious task indeed.

 

i tried toggling the null/not null settings in the table, but it doesn't seem to make any difference.

 

what am i doing wrong?

nothing. it just leaves the cell blank.

 

this is for a rollover widget. some rollovers have 16 images but most only have 15 so the client-side script is set up to display a placeholder image if #16=null. so my table is *supposed* to add NULL into all empty cells on my CSV import. but it isn't putting anything in there, so when i view the html pages, if there is only 15 images, the 16th place shows up as a broken image

0 rows affected.

 

i've also thought about the whitespace factor, but checking those individual cell in phpmyadmin confirms that they are indeed empty. i don't get it.

 

isn't there a way to set the table to automatically change empty cells to "NULL"?

 

 

it's set to varchar 25. the longer entries (modelnumber-##.jpg) are coming through just fine, so i really don't think lenghth is an issue.

 

it will let me go through and /manually/ change the emtpy feilds to NULL, then it will work like it's supposed to. however, each time i update the table by importing (and over-writing) the sheet i have to go through an manually update all the rows again. it's really frustrating.

 

i have the default value set to NULL, so what gives? is there a setting somewhere that i'm just not configuring correctly?

SELECT LENGTH(`ImageTh_06`) AS `length`, *  FROM `rollover`

 

For those entries that are supposed to be NULL, what are their lengths?

I don't understand the question -- I was trying to figure out why they weren't being updated.

 

But ultimately if you import "blank" then you'll get blank -- not null.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.