Book to SQL not working?

Discussion in 'Databases' started by Matt Ridge, Sep 19, 2011.

  1. #1
    I have the book Headfirst PHP & MySQL... now I'm already frustrated on a few things they are teaching me, but I am looking at page 64 of the book, it gives me a code command to write into phpMyAdmin.

    My service is hostgator, and as far as I can tell they are using MySQL 5.5...

    It the book it tells me to write this code to send to the database;


    Create Table aliens_abduction ( 
    first_name varchild (30),
    last_name varchild (30),
    when_it_happened varchild (30),
    how_long varchild (30),
    how_many varchild (30),
    alien_description varchild (100),
    fang_spotted varchild varchild (10),
    other varchild (100),
    email varchild (50),
    );
    Code (markup):

    When entering it into phpMyAdmin, I get this error:



    Any idea what is going on and why?

    By all intended purposes I am doing this correctly... at least by the book.
     
    Matt Ridge, Sep 19, 2011 IP
  2. kmap

    kmap Well-Known Member

    Messages:
    2,215
    Likes Received:
    29
    Best Answers:
    2
    Trophy Points:
    135
    #2
    it shd be like this


    Create Table aliens_abduction (
    first_name varchar (30),
    last_name varchar (30),
    when_it_happened varchar (30),
    how_long varchar (30),
    how_many varchar (30),
    alien_description varchar (100),
    fang_spotted varchild varchar (10),
    other varchar (100),
    email varchar (50),
    );

    I hope it helps

    Regards

    Alex
     
    kmap, Sep 19, 2011 IP
  3. Matt Ridge

    Matt Ridge Peon

    Messages:
    166
    Likes Received:
    0
    Best Answers:
    1
    Trophy Points:
    0
    #3
    Still get the same error...
     
    Matt Ridge, Sep 19, 2011 IP
  4. Rukbat

    Rukbat Well-Known Member

    Messages:
    2,908
    Likes Received:
    37
    Best Answers:
    51
    Trophy Points:
    125
    #4
    fang_spotted varchild varchar (10),

    should be

    fang_spotted varchar (10),

    I don't know where you got "varchild", but it should be "varchar". There's no "varchild" in SQL.
     
    Rukbat, Sep 19, 2011 IP
  5. Matt Ridge

    Matt Ridge Peon

    Messages:
    166
    Likes Received:
    0
    Best Answers:
    1
    Trophy Points:
    0
    #5
    probably a typo that the program corrected by mistake... thanks though.
     
    Matt Ridge, Sep 19, 2011 IP
  6. akumar2

    akumar2 Peon

    Messages:
    30
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    varchild ;)
    It should be varchar ..
     
    akumar2, Sep 20, 2011 IP