Discover Habbo's history
Treat yourself with a Secret Santa gift.... of a random Wiki page for you to start exploring Habbo's history!
Happy holidays!
Celebrate with us at Habbox on the hotel, on our Forum and right here!
Join Habbox!
One of us! One of us! Click here to see the roles you could take as part of the Habbox community!


Results 1 to 2 of 2
  1. #1
    Join Date
    Apr 2007
    Location
    GTA: SA
    Posts
    337
    Tokens
    0

    Default Who knows MySQL?

    Hi, I'm learning to code in PHP - and I'm doing very good!

    But, something that I don't know is making a mysql database... I don't understand all the pieces, for example:

    Code:
    CREATE TABLE `users` (
    `id` int(11) NOT NULL auto_increment,
    `username` varchar(30) NOT NULL default '',
    `password` varchar(255) NOT NULL default '',
    `email` varchar(40) NOT NULL default '',
    `msn` varchar(250) NOT NULL default 'Not Specified',
    `aim` varchar(250) NOT NULL default 'Not Specified',
    `location` varchar(36) NOT NULL default 'Not Specified',
    PRIMARY KEY (`id`)
    ) TYPE=MyISAM;
    So, the first part makes a table, called users. I understand that. The id is the users id, it isn't null, so it has to be something, and goes up everytime. What is the int(11)?
    Next we have username... not null, so user has to have something, default isn't anything... again, whats this? varchar(30)? I saw somewhere int means you can't have things like - @ etc, and varchar you can have letters numbers - @ etc...

    But what are the numbers? On email it's (40) on aim it's (250)... what do they mean, thats all I need to know tbh!

    - Thanks and +rep if you can help me!

    Xotuako
    I wont be on so much this week - but I'll be on. :8

  2. #2
    Join Date
    Apr 2007
    Location
    GTA: SA
    Posts
    337
    Tokens
    0

    Default

    OO, just missed editing it! Sorry for double post, cannot edit

    I think I understand... the numbers are the max characters the value can have? Please correct me if wrong And explain a little more!
    I wont be on so much this week - but I'll be on. :8

Posting Permissions

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