Here is the error my code generated:

1064: You have an error in your SQL syntax near 'id #2' at line 1 in 
INSERT INTO blogger_categories SET blogc_pid = '0', blogc_name = 'sdfsafd', blogc_desc = ''

Here is the table structure:

#
# Table structure for table `blogger_categories`
#
CREATE TABLE blogger_categories (
  blogc_id int(11) NOT NULL auto_increment,
  blogc_name varchar(255) NOT NULL default '',
  blogc_desc tinytext NOT NULL,
  blogc_pid int(11) NOT NULL default '0',
  PRIMARY KEY  (blogc_id)
) TYPE=MyISAM;

Im kinda confused about it

    your syntax is wrong. SET is used with UPDATE's. Try this

    INSERT INTO blogger_categories(blogc_pid, blogc_name, blogc_desc) VALUES('0', 'sdfsafd', '')

    Cgraz

      1064: You have an error in your SQL syntax near 'Resource id #2' at line 1 in
      INSERT INTO blogger_categories (blogc_pid, blogc_name, blogc_desc) VALUES('0', 'moo', 'mooo ')

        FIRST :

        The INSERT INTO table SET col='value' syntax is entirely acceptable in many SQL based languages including MySQL. I use it all the time. It's a lot easier to keep stuff straight with

        SET
        cola='value a'
        colb='value b'
        colc='value c'

        etc...

        esp when you have 20-30 columns in a table that you're trying to populate.


        SECOND:

        In my (limited) experience with MySQL errors I have twice had errors that referenced a "RESOURCE" (like yours:You have an error in your SQL syntax near 'Resource id #2' ).

        These have shown up when I have a problem with the database. This has happened on a couple of occasions on my local PC hard-disk after an unexpected shutdown. I solved the problem by dropping and recreating the table. I couldn't dump the data from the broken tables -- another resource error -- and had to use backup data.

          Write a Reply...