<?php
$conn=mysqli_connect("localhost","root","","telephasic");
if(isset($_GET['role']))
{
$role1=$_GET['role'];
$query = "SELECT * FROM register WHERE id='$role1'";
while($row=mysql_fetch_object($query))
{
$role_var=$row->role;
if($role_var=='1')
{
$role_state="NULL";
} else {
$role_state="0";
}
$update=mysql_query("update register set status='$role_state' where id='$role1' ");
if($update)
{
header("Location:admin.php");
} else {
echo mysql_error();
}
}
?>
<?php } ?>
I am getting error here so help me please
Fatal error: Uncaught Error: Call to undefined function mysql_fetch_object() in C:\xampp\htdocs\telephasic\action.php:7 Stack trace: #0 {main} thrown in C:\xampp\htdocs\telephasic\action.php on line 7