mysql - Matching id reference between two tables and exclude result with connection user id -


i have 2 tables - simplified this:

//table player_img_id || player_img_category_id  //table b user_play_uid || user_play_img_id (reference table a: player_img_id) 

how show results table a exclude rows based on reference entries table b result_should_exclude_reference_with instance user_play_uid = 1 , user_play_img_id == player_img_id.

basically want show results table dont have referenced user entry in table b. note: start of with, there no user entries in table b

any suggestions?

as suggested in comment found solution reading bit on joins here: http://www.codinghorror.com/blog/2007/10/a-visual-explanation-of-sql-joins.html

the query needed following:

select * player_img   left outer join user_play   on user_play.user_play_entry_player_img_id = player_img.player_img_id   , user_play.user_play_uid != $this->user_uid   user_play.user_play_entry_player_img_id null 

Comments

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -