Jump to content

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.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.