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 12
  1. #1
    Join Date
    Dec 2006
    Posts
    3,970
    Tokens
    0

    Latest Awards:

    Default MYSQL - is this possible

    For a database I have 2 tables setup, they are like-



    I need to order the first table by num (SELECT * FROM `table1` ORDER BY `num` DESC) then I need to match the ID of that to the id in table 2. And it probs needs to be done in 1 mysql query because it needs to be used with mysql_fetch_assoc().

    Sorry if what I've said is confusing. I have tried my best to explain it

    +Rep for any help

    Thanks.
    Lets set the stage on fire, and hollywood will be jealous.

  2. #2
    Join Date
    Jul 2008
    Posts
    535
    Tokens
    75

    Default

    Why not add it all into one table instead of two?

  3. #3
    Join Date
    Dec 2006
    Posts
    3,970
    Tokens
    0

    Latest Awards:

    Default

    What I have shown there is a simplyfied example, there is more than 1 of table 1. I am just explaining what the problem is with 2 tables.
    Lets set the stage on fire, and hollywood will be jealous.

  4. #4
    Join Date
    Nov 2007
    Posts
    1,253
    Tokens
    150

    Latest Awards:

    Default

    It would be better to have it all in 1 table, it wouldn't affect the speed of the site/query. Honestly.


    www.fragme.co = a project.

  5. #5
    Join Date
    Jul 2008
    Posts
    535
    Tokens
    75

    Default

    nevermind.

  6. #6
    Join Date
    Nov 2008
    Posts
    75
    Tokens
    0

    Default

    You can access other things in other tables by table.field, if you didn't already know that.
    ;; Joshua Mingle
    ;; API Developer
    ;; TehUpload

  7. #7
    Join Date
    Dec 2006
    Posts
    3,970
    Tokens
    0

    Latest Awards:

    Default

    Quote Originally Posted by Source View Post
    It would be better to have it all in 1 table, it wouldn't affect the speed of the site/query. Honestly.
    How many rows would there need to be before it starts effecting the speed of my site?
    Lets set the stage on fire, and hollywood will be jealous.

  8. #8
    Join Date
    Jul 2008
    Posts
    535
    Tokens
    75

    Default

    Quote Originally Posted by Decode View Post
    How many rows would there need to be before it starts effecting the speed of my site?
    I have about 20 rows in my users table, it works fine. You also don't have to worry about speed when all you have is around 7/8 rows.

  9. #9
    Join Date
    Dec 2006
    Posts
    3,970
    Tokens
    0

    Latest Awards:

    Default

    Quote Originally Posted by wsg14 View Post
    I have about 20 rows in my users table, it works fine. You also don't have to worry about speed when all you have is around 7/8 rows.
    Where do u get 7/8 rows from lol, I am hoping I will have lots more than that

    EDIT: I think you have mistaken columns for rows
    Lets set the stage on fire, and hollywood will be jealous.

  10. #10
    Join Date
    Jul 2008
    Posts
    535
    Tokens
    75

    Default

    I got it from your diagram, how many rows do you expect to have?

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
  •