php - Looping through a mysqli result -


i'm trying display list of status updates artists logged in user following.

so far have this:

#get list of artists user has liked $q = "select * artist_likes user_id = '1' "; $r = mysqli_query($dbc,$q); while ($row = mysqli_fetch_array($r, mysqli_assoc)) {    #now grab statuses each artist   $status_query = "select * status_updates artist_id = '".$row['artist_id']."' ";   $status_result = mysqli_query($dbc,$status_query)  } 

but i'm not sure how loop through , display returned status updates?

this isn't strong point of mine, pointers appreciated!

just avoiding multiple query, can use 1 query this:

select l.*, s.*  artist_likes l, status_updates s l.artist_id = s.artist_id , l.user_id = '1' 

or

select l.*, s.*  artist_likes l join status_updates s on (l.artist_id = s.artist_id) l.user_id = '1' 

Comments

Popular posts from this blog

basic authentication with http post params android -

vb.net - Virtual Keyboard commands -

How to get multiresult with multicondition in Sql Server -