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!


Page 1 of 2 12 LastLast
Results 1 to 10 of 13

Thread: mySQL with PHP?

  1. #1
    Join Date
    Jun 2006
    Posts
    4,832
    Tokens
    0

    Latest Awards:

    Default mySQL with PHP?

    Hey, I was looking on techtuts and when making a database you have to add the code table in myPHPadmin thing/mySQL thing, for shoutboxes or storing data (you could use flatfiles, but I'd prefer mySQL), how do they make them?

    Could somebody explain, or point me in the right direction. Or even tell me a site.

    Taken from a tutorial site:

    Code:
    CREATE TABLE `shoutbox` (
    `id` int(11) NOT NULL auto_increment,
    `name` text NOT NULL,
    `message` longtext NOT NULL,
    `time` text NOT NULL,
    PRIMARY KEY  (`id`)
    ) TYPE=MyISAM;
    I don't get how it works, or how they make the code, as I said, can somebody explain?

    +REP to any helpers!

  2. #2
    Join Date
    Nov 2004
    Location
    HabboWeb FM Offices
    Posts
    3,019
    Tokens
    0

    Latest Awards:

    Default

    Go to sql on cpanel, then to phpMyAdmin, select your database and click sql, paste the code in there

  3. #3
    Join Date
    Jun 2006
    Posts
    4,832
    Tokens
    0

    Latest Awards:

    Default

    Did you miss-read? I want to know how to make them, not how to run them, I already know how to run them. I want to know, what do you do if you were, lets say, making a forum. What would you need if the forum had a profile, users, pm system and basic posting?

  4. #4
    Join Date
    May 2006
    Posts
    44
    Tokens
    0

    Default

    Quote Originally Posted by Zengo View Post
    Did you miss-read? I want to know how to make them, not how to run them, I already know how to run them. I want to know, what do you do if you were, lets say, making a forum. What would you need if the forum had a profile, users, pm system and basic posting?
    What blob said is how to make the tables in phpmyadmin.As far as I know that's what you want

  5. #5
    Join Date
    Jun 2006
    Posts
    4,832
    Tokens
    0

    Latest Awards:

    Default

    Saying "Go to sql on cpanel, then to phpMyAdmin, select your database and click sql, paste the code in there" isn't helping me make anything? It's telling me to paste a code into phpmyadmin, which i dont want. I want how to make a MySQL code thing, like what each thing does.

    Like what does "`id` int(11) NOT NULL auto_increment" do? What does each line mean?
    Last edited by Hitman; 07-09-2006 at 07:52 PM.

  6. #6
    Join Date
    Feb 2006
    Location
    Ontario Canada
    Posts
    4,587
    Tokens
    0

    Latest Awards:

    Default

    id is like the number of the feild like say in my search pixel resources id is 1 int11 i have no idea what that means say with not null auto_increment is auto set next aviable number.

    Edit: http://www.techtuts.com/?view=tutori...utorial&id=440
    Last edited by Colin-Roberts; 07-09-2006 at 08:29 PM.

    .:.:#14:.:. .:.: Impossible Is Nothing :.:. .:.: 845 Rep:.:.
    .:.: Stand up for what is right, even if you stand alone:.:.


  7. #7
    Join Date
    Jul 2006
    Posts
    202
    Tokens
    0

    Default

    auto_increment is to automatically create an id, like 1, 2, 3, 4, 5, 6, 7, 8, 9, 10.. Etc.
    Pssht

  8. #8
    Join Date
    Aug 2004
    Location
    UK
    Posts
    11,283
    Tokens
    2,031

    Latest Awards:

    Default

    are you asking how to get php to exicute the Mysql code? or how to structure mysql code itself?

  9. #9
    Join Date
    Jun 2006
    Posts
    4,832
    Tokens
    0

    Latest Awards:

    Default

    Quote Originally Posted by Soccer-Pro View Post
    id is like the number of the feild like say in my search pixel resources id is 1 int11 i have no idea what that means say with not null auto_increment is auto set next aviable number.

    Edit: http://www.techtuts.com/?view=tutori...utorial&id=440
    Thanks, I'll check it out!

    Quote Originally Posted by Motion View Post
    auto_increment is to automatically create an id, like 1, 2, 3, 4, 5, 6, 7, 8, 9, 10.. Etc.
    Ok thanks Ryan.

    Quote Originally Posted by 01101101entor View Post
    are you asking how to get php to exicute the Mysql code? or how to structure mysql code itself?
    I want to structure the code. I want to just learn what each part does, so when I come to making something that needs a database in mysql, i will be able to make one.

  10. #10
    Join Date
    Aug 2004
    Location
    UK
    Posts
    11,283
    Tokens
    2,031

    Latest Awards:

    Default

    CREATE TABLE `shoutbox` (

    Tells mysql you want to create a table, and that it should be called 'shoutbox'

    `id` int(11) NOT NULL auto_increment,

    Tells mysql in this table (its between the bracktes) you want to create a field. The first part tells it the fild is named ID the second part is the data type, in this instance, its int or intiger and the lengh of the field is 11. The net part says the value in the table cant be null. null being nothing, in this case the start value will automaticly be 0. Auto incriment means each row gets a unqie number

    `name` text NOT NULL,

    Same. except its a text field, and does auto incriment

    `message` longtext NOT NULL,

    Same again pretty much, except longtext

    `time` text NOT NULL,

    yet again pretty much the same

    PRIMARY KEY (`id`)

    Sets primary key, as id, basicly means its ordered by it by defult

    ) TYPE=MyISAM;

    ends sql add table code, says table type is MyISAM, although in some of the newer mysql relices InnoDB is starting to take over "/

    ps. Theres no php in that, its just the sql
    Last edited by Mentor; 08-09-2006 at 06:40 PM.

Page 1 of 2 12 LastLast

Posting Permissions

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