[SOLVED] Grabbing data from another table using INNER Join.

Brad

Well-Known Member
Jun 5, 2012
2,320
993
So I'm trying to grab items from a table WHERE the items ID = 202, but where the user_ids RANK is < 4 . but the Items table doesn't define the rank so you'd have to grab that from the other table (users). I'm using INNER JOIN which I've never done before and it's confusing the hell out of me.

Here's my current code.
PHP:
                        $result = mysql_query("SELECT i.base_item, i.user_id FROM items WHERE i.base_item ='202' AS i
                        INNER JOIN users AS u
                        ON i.user_id= u.id WHERE u.rank < 4");
                      
                         $num_rows = mysql_num_rows($result);
This isn't grabbing anything so I don't know what needs fixing. Thanks
 

Users who are viewing this thread

Top