SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    I'm a splitzer's Avatar
    Join Date
    Dec 2005
    Location
    California
    Posts
    257
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    how to set longblob to null

    Hi,
    I have images in my table as longblob type. I tried using the UPDATE statement to set the column to null, but for some reason it didnt update. It did show the query was successful.

    I tried something along this line:
    update icons
    set icon = null
    WHERE icon_location is not null

    Thanks,

  2. #2
    Utopia, Inc. silver trophy
    ScallioXTX's Avatar
    Join Date
    Aug 2008
    Location
    The Netherlands
    Posts
    9,094
    Mentioned
    153 Post(s)
    Tagged
    2 Thread(s)
    Is NULL allowed for the field? i.e. you didn't define it with NOT NULL?
    Can you show a SHOW CREATE TABLE for the concerned table?
    Rémon - Hosting Advisor

    SitePoint forums will switch to Discourse soon! Make sure you're ready for it!

    Minimal Bookmarks Tree
    My Google Chrome extension: browsing bookmarks made easy

  3. #3
    I'm a splitzer's Avatar
    Join Date
    Dec 2005
    Location
    California
    Posts
    257
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I have it set as default value of null. I thought I would be able to replace binary data with null value or some default value.

    CREATE TABLE `icons` (
    `id` int(11) NOT NULL auto_increment,
    `icon` longblob,
    `icon_location` varchar(200) default NULL,
    PRIMARY KEY (`id`)
    ) ENGINE=InnoDB AUTO_INCREMENT=67436 DEFAULT CHARSET=latin1

  4. #4
    I'm a splitzer's Avatar
    Join Date
    Dec 2005
    Location
    California
    Posts
    257
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Any suggestions?


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •