How to get users details without knowing any field in that table???????

i Have 3 table with following fields,

1.users table

id, name, password, sub category id, email

2. category table

categorie name, category id

3.subcategory table

sub category name, sub category id, category id

my questian is, how to get users details from user table using category id??? pleae help

You JOIN the tables on the common field.

SELECT users.id, users.name
FROM users JOIN subcategory ON users.subCategoryID = subcategory.subCategoryID
WHERE subcategory.categoryID = TheCategoryIdThatYouKnow
Sponsor our Newsletter | Privacy Policy | Terms of Service