我試圖顯示登錄用戶所關注的藝術家的狀態更新列表。通過mysqli結果循環
到目前爲止,我有這樣的:
#Get the list of artists that the user has liked
$q = "SELECT * FROM artist_likes WHERE user_id = '1' ";
$r = mysqli_query($dbc,$q);
while ($row = mysqli_fetch_array($r, MYSQLI_ASSOC)) {
#Now grab the statuses for each artist
$status_query = "SELECT * FROM status_updates WHERE artist_id = '".$row['artist_id']."' ";
$status_result = mysqli_query($dbc,$status_query)
}
,但我不知道如何來遍歷並顯示返回的狀態更新?
這不是我的強項,所以任何指針都將不勝感激!
使用內循環的同時,像你遍歷第一個查詢的結果。 – Achrome