while ($row =mysql_fetch_assoc($result)){
<?php 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 "<div>"; if (rowImg['status'] ==0) { echo "<img src ='uploads/profile".$id.".jpg?".mt_rand()."'>"; } else { echo "<img src='uploads/profiledefault.jpg'>"; } echo $row['username']; echo "</div>"; } } } else { echo "There are no users yet!"; } ?>
while ($rowImg = mysql_fetch_assoc($resultImg))
From PHP: mysql_fetch_assoc - Manual[^] Warning This extension was deprecated in PHP 5.5.0, and it was removed in PHP 7.0.0. Instead, the MySQLi or PDO_MySQL extension should be used. See also MySQL: choosing an API guide and related FAQ for more information
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)