• Resolved amyleforge

    (@amyleforge)


    I have watched every. single. video you have on YouTube, and then tried to design and create a table. If I put a value in the default column for person_id, I get an error message that the value is wrong. If I leave it blank, then I get an error that there is a syntax problem. But I don’t see where the syntax is wrong. Can you help?

    Here is the script:

    CREATE TABLEnew_registration`
    (person_id int NOT NULL auto_increment
    ,email_address varchar NOT NULL
    ,first_name varchar NOT NULL
    ,last_name varchar NULL
    ,street_address varchar NULL
    ,city varchar NULL
    ,state varchar NULL
    ,zip int NULL
    ,phone varchar NULL
    ,PRIMARY KEY (person_id)
    ) ENGINE InnoDB DEFAULT CHARACTER SET utf8 COLLATE=utf8_general_ci;

    CREATE UNIQUE INDEX email ON new_registration (email_address);`

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Passionate Programmer Peter

    (@peterschulznl)

    Hi Amy,

    Sorry for my late reply! There are a few errors in your script:
    – add a backtick before the table name (it only has one at the end) or don’t use backticks at all (like you did for your columns)
    – make sure you add a length to your varchar columns (e.g. varchar(100))

    This script runs on my server:

    CREATE TABLE new_registration
    (person_id int NOT NULL auto_increment
    ,email_address varchar(10) NOT NULL
    ,first_name varchar(10) NOT NULL
    ,last_name varchar(10) NULL
    ,street_address varchar(10) NULL
    ,city varchar(10) NULL
    ,state varchar(10) NULL
    ,zip int NULL
    ,phone varchar(10) NULL
    ,PRIMARY KEY (person_id)
    ) ENGINE InnoDB DEFAULT CHARACTER SET utf8 COLLATE=utf8_general_ci

    The create index is fine.

    Hope this helps,
    Peter

    Thread Starter amyleforge

    (@amyleforge)

    Okay, but here’s the thing. I didn’t write the SQL. I used the advanced interface and entered the requirements. The code I gave you is what the plugin generated based on what I put in the create table interface.

    I have deleted everything and started over, and still the same thing happens. It’s very confusing.

    Also, what’s a backtick? Are we talking single quote or slash? Sorry for not knowing what you are referring to.

    Thanks

    Amy

    Thread Starter amyleforge

    (@amyleforge)

    Ohhh! I see what a backtick is. Sorry. ??

    Plugin Author Passionate Programmer Peter

    (@peterschulznl)

    Hi Amy,

    Thanks for replying! It looks like the Data Designer is not giving a message when you forget to add the column length for varchar columns. It should do that! I’ll fix this asap.

    Thanks,
    Peter

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Create Table keeps failing’ is closed to new replies.