1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Error performing query 'DROP TABLE IF EXISTS `xxx`; ': You have an error ...

Discussion in 'Databases' started by jeeplaw, Feb 8, 2008.

  1. #1
    For the life of me, i can't figure out where that strange character is coming from. I'm loading a sql dump into a blank db, and i made sure that the sql dump is devoid of any strange characters. Opened and saved it in both notepad adn pspad.
    I thought maybe that this line would be of interest:

    ENGINE=MyISAM DEFAULT CHARSET=latin1;

    But changing it to just ENGINE=MyISAM; doesn't really have an effect.

    The good thing is that the rest of the sql dump install goes smooth since it's a fresh db. My only concern is where that strange character, on line 1 no less is coming from.

    Any ideas?

    Code (Text):
    1.  
    2. DROP TABLE IF EXISTS `xxx`;
    3. CREATE TABLE `articles` (
    4.   `xxx` int(11) NOT NULL auto_increment,
    5.   `xxx` int(11) NOT NULL,
    6.   `xxx` int(11) NOT NULL,
    7.   `xxx` text NOT NULL,
    8.   `xxx` text NOT NULL,
    9.   `xxx` longtext NOT NULL,
    10.   `xxx` tinyint(1) NOT NULL,
    11.   `xxx` float(8,2) NOT NULL,
    12.   `xxx` int(11) NOT NULL,
    13.   `xxx` int(11) NOT NULL,
    14.   `xxx` int(11) NOT NULL,
    15.   `xxx` int(11) NOT NULL,
    16.   `xxx` tinyint(1) NOT NULL,
    17.   `xxx` tinyint(1) NOT NULL,
    18.   PRIMARY KEY  (`axxxID`)
    19. ) ENGINE=MYISAM CHARSET=latin1;
    20.  
    jeeplaw, Feb 8, 2008 IP
  2. richRemer

    richRemer Peon

    Messages:
    1
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Those characters are the an ASCII rendering of the UTF-8 Byte Order Mark. Most UTF-8 is perfectly valid ASCII, so often you won't even realize you're using UTF-8 encoded files with ASCII-only interpreters. But, some characters in UTF-8 can show up in ASCII in either little-endian or big-endian form. To indicate to the interpreter which version the UTF-8 data uses, the Byte Order Mark character (0xFEFF) is inserted into the beginning of the data. If the interpreter doesn't follow this (non-standard but common) convention, it instead interprets the character as those three ASCII chars you are seeing.

    The solution is to simply save your file as UTF-8 without BOM or as plain ASCII (if you are not using any non-ASCII characters).
    richRemer, Apr 28, 2010 IP