Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Senior Coder whizard's Avatar
    Join Date
    Jan 2005
    Location
    Philadelphia, PA, USA
    Posts
    1,662
    Thanks
    14
    Thanked 76 Times in 76 Posts

    Query Error when creating a table

    Hello all

    I am getting an error when I try to run a query on my site. I can't seem to figure out what's wrong with it, and I thought some of you might know.

    Here's the error:
    Could not complete because: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'DEFAULT CHARSET=latin1 AUTO_INCREMENT=18 ; INSERT INTO `users`
    Here's the Query
    Code:
    CREATE TABLE `users` (
      `id` tinyint(10) NOT NULL auto_increment,
      `permission` tinyint(1) NOT NULL default '0',
      `username` varchar(20) NOT NULL default '',
      `password` text NOT NULL,
      `email` varchar(100) NOT NULL default '',
      PRIMARY KEY  (`id`),
      UNIQUE KEY `username` (`username`)
    ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=18 ;
    
    INSERT INTO `users` VALUES (-, --, '---', '----', '-----');
    INSERT INTO `users` VALUES (-, --, '---', '----', '-----');
    INSERT INTO `users` VALUES (-, --, '---', '----', '-----');
    INSERT INTO `users` VALUES (-, --, '---', '----', '-----');
    INSERT INTO `users` VALUES (-, --, '---', '----', '-----');
    INSERT INTO `users` VALUES (-, --, '---', '----', '-----');
    INSERT INTO `users` VALUES (-, --, '---', '----', '-----');
    INSERT INTO `users` VALUES (-, --, '---', '----', '-----');
    INSERT INTO `users` VALUES (-, --, '---', '----', '-----');
    INSERT INTO `users` VALUES (-, --, '---', '----', '-----');
    (I removed the information I am inserting, since that's not where the error is...)

    Thanks in Advance!

    Dan
    PHP Tip: If you want to use short tags (<? or <?=$var) then make sure short_open_tag is set to "1". It really helps.

    Don't forget to save everyone time and mark your thread as Resolved :)

    "Also note that it is your responsibility to die() if necessary."

    DON'T USE THE MYSQL_ EXTENSION

  • #2
    Super Moderator guelphdad's Avatar
    Join Date
    Mar 2006
    Location
    St. Catharines, Ontario Canada
    Posts
    2,633
    Thanks
    4
    Thanked 148 Times in 139 Posts
    try removing the charset information.


  •  

    Posting Permissions

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