I have three tables for streaming data from database
stream_master
stream_id
user_id -> foreign Key
stream_title
stream_content
user
user_id
user_name
password
stream_likes
stream_like_id
stream_id
user_id
I can join together to get data stream, but I want to get “stream_likes” data for each “stream_master” rows, based on user(Logged in) activity. Mean if user already like stream get 1 for each row
Is this possible to execute in single query ?
my output should be :
[stream_id => 10,
user_id => 10015,
stream_title=>"title of stream",
stream_content="stream content",
stream_like=>1],
[stream_id => 10,
user_id => 10018,
stream_title=>"title of stream222",
stream_content="stream content22",
stream_like=>0]
I am not able to find a nice solution for this. Could someone can help me on this?
Thanks
Peter
Would that work for you?