Results 1 to 6 of 6
  1. #1
    Join Date
    Oct 2004
    Posts
    29

    Exclamation Unanswered: PHPMyAdmin Error

    I am using PHPMyAdmin to create my MySQL database and test it by running some queries on it. I've created the database which was fine but when trying to create a table for that database (using the provided GUI) I keep getting this error:

    MySQL said:

    #1064 - 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 '(32) NOT NULL, `Last_Name ` TEXT(32) NOT NULL, `Username ` VARC

    This is the CREATE TABLE syntax that PHPMyAdmin genereates:

    SQL-query:

    CREATE TABLE `Person` (

    `Person_ID ` INT( 10 ) NOT NULL AUTO_INCREMENT ,
    `First_Name ` TEXT( 32 ) NOT NULL ,
    `Last_Name ` TEXT( 32 ) NOT NULL ,
    `Username ` VARCHAR( 32 ) NOT NULL ,
    `Password ` VARCHAR( 32 ) NOT NULL ,
    `PersonType_ID ` INT( 10 ) NOT NULL ,
    PRIMARY KEY ( `Person_ID ` )
    ) TYPE = MYISAM


    I don't understand why it uses all the quotes, I'm confused ?????????

    Regards

    Wealth-Builderz
    Last edited by Wealth-Builderz; 11-30-04 at 09:15.

  2. #2
    Join Date
    Jul 2003
    Posts
    73
    Are you actually including a space character after each column name? In the script you provided (and error message) there is a space character after Person_ID enclosed in the quotes. I'm not sure if this might be causing the issue.
    Joel Dixon
    Analyst Programmer
    Melbourne, Australia

  3. #3
    Join Date
    Jul 2003
    Posts
    73
    sorry - my reply was duplicated.
    Last edited by joeldixon66; 11-29-04 at 21:13. Reason: Duplicate Post

  4. #4
    Join Date
    Oct 2004
    Posts
    29
    I'm using the PHPMyAdmin GUI to enter my table name and it's accompanying attributes and this is how the code is generated. I know it's syntax is not correct but it's auto-generated so surely it should be correct and run! Very strange??????
    Last edited by Wealth-Builderz; 11-30-04 at 09:16.

  5. #5
    Join Date
    Oct 2004
    Posts
    29

    Exclamation

    It's ok I've sussed it. Thanks for your reply anyway.

  6. #6
    Join Date
    Feb 2004
    Posts
    533
    I can't comment on PHPMyAdmin because I haven't used it much. I've been using SQL Yog, which has some great tools for creating tables, testing SQL and just about anything your going to need for managing MySQL Databases. You can get info and download a copy, free for personal and comercial use, at:

    http://www.webyog.com/index.php



    .
    ~

    Bill

Posting Permissions

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