$query = "SELECT * FROM owners";
$result = mysqli_query($connection, $query);
$data = mysqli_fetch_assoc($result);
while($row = mysqli_fetch_assoc($result)) {
echo $row['uuid'];
}
這不工作就不會工作,但如果我這樣做如何循環訪問MySQL查詢結果?我用盡了一切,它
$result = mysqli_query($connection, $query);
$data = mysqli_fetch_assoc($result);
while($row = $data) {
echo $row['uuid'];
}
它只是修建垃圾的畫面,它意味着要打印的文本。
檢查這個問題 https://stackoverflow.com/questions/5218088/mysql-fetch-array-does-not-retrieve-all-rows –
如果你只想要uuid,你應該改變你的查詢,只返回uuid。 (用uuid替換*)不管你是否使用它,數據庫都會返回表中的所有內容。 –
預期產出/結果是什麼? – DanielO