How to make a selection mysqli?

Hi all.
I must say that I'm not a programmer.
I had that kind of problem
$limit = 360;
$time = time();

$last_id = (int)$_GET['id'];

set_time_limit($limit+5);

$mysqli = new mysqli('localhost', 'root', ", 'comet');

/* check connection */
if (mysqli_connect_errno()) {
 printf("failed to connect: %s\n", mysqli_connect_error());
exit();
}

function escape($str) {
 return str_replace('"','\"',$str);
}

$query = 'SELECT * FROM `comet` WHERE `id`>"'.$last_id.'" ORDER BY `id` ASC';

if ($result = mysqli_query($mysqli, $query)) {

 /* fetching data and putting them into an array */
 while ($row = mysqli_fetch_row($result)){
 echo 'self.putMessage("'.$row['id'].'","'.escape($row['name']).'","'.escape($row['text']).'");';
}

 /* free result set */
mysqli_free_result($result);
}

mysqli_close($mysqli);

This code will take you back to the data via ajax every 5 seconds and check the database.
but an error occurs

PHP Warning: mysqli_fetch_row() expects exactly 1 parameter, 2 given in E:\Dropbox\shared\OpenServer\domains\comet\backend.php on line 26

How can I fix it?
July 8th 19 at 16:44
1 answer
July 8th 19 at 16:46
Solution
You or not the code cited, or error from another location. Using mysqli_fetch_row right, it takes 1 parameter, you can pass.

Find more questions by tags PHPMySQL