这是数据表,命名为"flagged_thread ">
flagged_threadID | threadID | userID | 1 | 2 | 1 | 2
---|---|---|
3 | 1 | |
3 | 6 | 1 |
查看mysqli_fetch_assoc的文档:https://www.php.net/manual/de/function.mysql-fetch-assoc.php
你必须像这样在循环中使用这个函数:
$flagged_sql = "SELECT threadID FROM flagged_threads WHERE userID = 'current_userID'";
$flagged_qry = mysqli_query($dbconnect, $flagged_sql);
while($flagged_aa = mysqli_fetch_assoc($flagged_qry)) {
// do something with $flagged_aa
}