Why is there an error thrown?

Hello! There is a simple script:
$dbtable = 'vhosts';
$connection = mysqli_connect('localhost', 'xxx', 'xxx', 'xxx');
$wwwlist = mysqli_query ($connection, "SELECT * FROM $dbtable WHERE userid = $user");
$data = mysql_fetch_array($wwwlist);
echo $data;

The error logs I see that the error in the line $data = mysql_fetch_array($wwwlist);
The error itself: mysql_fetch_array () expects to be resource, boolean given on line ...
July 2nd 19 at 17:18
1 answer
July 2nd 19 at 17:20
Solution
Because you first use the mysqli extension to connect to and query, then mysql. Do not use mysql. It had long since expired.

Find more questions by tags PHP