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:

Fatal error: Uncaught Error: Call to undefined function mysql_fetch_assoc() in /opt/lampp/htdocs/basic-procedural-php-project/index.php:77 Stack trace: #0 {main} thrown in /opt/lampp/htdocs/basic-procedural-php-project/index.php on line 77

The code is as follows:






            

whatever

The database is as follows:

DB NAME: timesNumbers
DB TABLE NAME: data
COLUMNS: t_id, t_name, t_firstNo, t_secondNo

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 "
"; if (rowImg['status'] ==0) { echo "
Hướng dẫn undefined function mysql_fetch_assoc