mr.confused Posted July 6, 2012 Share Posted July 6, 2012 Hey there, basically I need help to separate the users from the staff in my items table i can do this by the user_id field in the items table. but in the items table there is no way of telling which user_id is a staff member. Only way to find out is in the users table by the rank field is there any way i would be able to do this? Quote Link to comment https://forums.phpfreaks.com/topic/265327-help-please/ Share on other sites More sharing options...
Mahngiel Posted July 6, 2012 Share Posted July 6, 2012 add a groups table with columns that delineate a group id and a group name. then associate each user with their respective group / rank. Quote Link to comment https://forums.phpfreaks.com/topic/265327-help-please/#findComment-1359730 Share on other sites More sharing options...
jcbones Posted July 6, 2012 Share Posted July 6, 2012 You will need to join the items table to the users table to limit the query based on the rank. example SELECT i.* FROM items AS i JOIN users AS u ON i.user_id = u.id WHERE u.rank = 'staff'; MySQL JOIN Syntax Quote Link to comment https://forums.phpfreaks.com/topic/265327-help-please/#findComment-1359742 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.