I want to retrieve all data from a table, so I use this code
<?php
    include("config.php");
    $sql = "SELECT * FROM ".$USERS;
    $sql_result = mysqli_query($connection, $sql);
    if ($sql_result) {
      while ($result = mysql_fetch_assoc($sql_result)) {
         echo $result;
       }
    } 
    else {
       die ('Could not execute SQL query '.$sql);
    }
?>
but got this warning:
 Warning: mysql_fetch_assoc() expects parameter 1 to be resource,
 object given in C:\xampp\htdocs\newSDP\phpscript\users.php on line 6
How can I fix it?
