Perad Posted February 4, 2010 Share Posted February 4, 2010 SELECT u.name, u.email, u.id, ug.group_id FROM users AS u INNER JOIN users_groups AS ug ON ug.user_id = u.id WHERE u.id = 10 users - id - name - email - password users_groups - user_id - group_id This should return 1 row with the following id, name, email, group_id Currently returns 0 rows. No idea why, there are no errors. The record exists in the user table and group table. Can anyone see anything wrong with the query? Quote Link to comment https://forums.phpfreaks.com/topic/190932-query-isnt-working-no-errors-any-ideas/ Share on other sites More sharing options...
Mchl Posted February 4, 2010 Share Posted February 4, 2010 If it doesn't throw an error (are you sure of that?) it means syntax is all right. Check your data again. SELECT * FROM users WHERE id = 10; SELECT * FROM users_groups WHERE user_id = 10; Quote Link to comment https://forums.phpfreaks.com/topic/190932-query-isnt-working-no-errors-any-ideas/#findComment-1006844 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.