Hướng dẫn undefined function mysql_fetch_assoc
I'm new to PHP and am looking for some beginner help. I don't understand why this simple while loop is not working. I've checked for syntax errors with various variations and don't think that's the case. The error says:
The code is as follows:
The database is as follows:
Can someone explain what the error means, the problem and how to fix it? I feel like it might be something basic that I'm not getting. Thanks for and help here. Also the db.php file includes: I am receiving the error "Call to undefined function mysql_fetch_assoc()" on this line of code; while ($row =mysql_fetch_assoc($result)){ This is the full php code I am using for the function. It is initially to upload a users profile picture if (!isset($_SESSION["currentUser"])) header("Location: userprofilepage.php"); session_start(); include("dbConnect.php"); $sql = "SELECT * FROM Users"; $result = $conn->query($sql); if (($result ) >0) { while ($row =mysql_fetch_assoc($result)){ $id =$row['id']; $queryImg = "SELECT * FROM profileimg WHERE userid='$id'"; $stmtImg = mysql_query($conn, $queryImg); while ($rowImg =mysql_fetch_assoc($resultImg)) { echo " |