[Pheonix] User-Furniture [SQL]

Results 1 to 5 of 5
  1. #1
    Enthusiast Saia is offline
    MemberRank
    Apr 2011 Join Date
    CanadaLocation
    26Posts

    config [Pheonix] User-Furniture [SQL]

    Some people found my other thread (http://forum.ragezone.com/f353/uber-...re-sql-742625/) very useful. They asked if I could make one of Pheonix as well. There are some slight database changes between Pheonix and Uber, so here is the revised working query for the Pheonix database.

    Search a Username:

    Replace the red with the username.

    Code:
    SELECT DISTINCT u.id AS 'User ID', u.username AS 'Username', u.rank AS 'Rank', i.base_item AS 'Furniture ID', (SELECT f.public_name FROM furniture f WHERE f.id = i.base_item LIMIT 0,1) AS 'Furniture Name', (SELECT COUNT(iq2.base_item) FROM items iq2 WHERE iq2.base_item = i.base_item) AS 'Count'
    FROM items i
    INNER JOIN users u
    ON i.user_id = u.id
    WHERE i.user_id = (SELECT uq2.id FROM users uq2 WHERE uq2.username = 'USERNAME' LIMIT 0,1)
    ORDER BY u.id ASC
    Display All:

    Code:
    SELECT DISTINCT u.id AS 'User ID', u.username AS 'Username', u.rank AS 'Rank', i.base_item AS 'Furniture ID', (SELECT f.public_name FROM furniture f WHERE f.id = i.base_item LIMIT 0,1) AS 'Furniture Name', (SELECT COUNT(iq2.base_item) FROM items iq2 WHERE iq2.base_item = i.base_item) AS 'Count'
    FROM items i
    INNER JOIN users u
    ON i.user_id = u.id
    ORDER BY u.id ASC
    Credits:

    Saia (saia.zurchmora@gmail.com).
    Last edited by Saia; 12-04-11 at 07:32 AM.


  2. #2
    Developer Quackster is offline
    DeveloperRank
    Dec 2010 Join Date
    AustraliaLocation
    3,484Posts

    Re: [Pheonix] User-Furniture [SQL]

    What are your 'slight' changes made? :O

  3. #3
    :joy: Jonteh is offline
    MemberRank
    Apr 2007 Join Date
    New York, USALocation
    3,372Posts

    Re: [Pheonix] User-Furniture [SQL]

    Do we really need things like this?

  4. #4
    Valued Member FAYSALKHAN is offline
    MemberRank
    Dec 2009 Join Date
    CanadaLocation
    135Posts

    Re: [Pheonix] User-Furniture [SQL]

    Quote Originally Posted by Saia View Post
    Some people found my other thread (http://forum.ragezone.com/f353/uber-...re-sql-742625/) very useful. They asked if I could make one of Pheonix as well. There are some slight database changes between Pheonix and Uber, so here is the revised working query for the Pheonix database.

    Search a Username:

    Replace the red with the username.

    Code:
    SELECT DISTINCT u.id AS 'User ID', u.username AS 'Username', u.rank AS 'Rank', i.base_item AS 'Furniture ID', (SELECT f.public_name FROM furniture f WHERE f.id = i.base_item LIMIT 0,1) AS 'Furniture Name', (SELECT COUNT(iq2.base_item) FROM items iq2 WHERE iq2.base_item = i.base_item) AS 'Count'
    FROM items i
    INNER JOIN users u
    ON i.user_id = u.id
    WHERE i.user_id = (SELECT uq2.id FROM users uq2 WHERE uq2.username = 'USERNAME' LIMIT 0,1)
    ORDER BY u.id ASC
    Display All:

    Code:
    SELECT DISTINCT u.id AS 'User ID', u.username AS 'Username', u.rank AS 'Rank', i.base_item AS 'Furniture ID', (SELECT f.public_name FROM furniture f WHERE f.id = i.base_item LIMIT 0,1) AS 'Furniture Name', (SELECT COUNT(iq2.base_item) FROM items iq2 WHERE iq2.base_item = i.base_item) AS 'Count'
    FROM items i
    INNER JOIN users u
    ON i.user_id = u.id
    ORDER BY u.id ASC
    Credits:

    Saia (saia.zurchmora@gmail.com).
    Thanks or this, even though I don't need it.

  5. #5
    sexiess is a sin. Subway is offline
    MemberRank
    Jun 2010 Join Date
    2,491Posts

    Re: [Pheonix] User-Furniture [SQL]

    it got delete :/



Advertisement