Имеется код:
$query = $mysqli->query("SELECT * FROM `users` ORDER BY `id` DESC LIMIT 10");
$row = $query->fetch_array();
foreach ( $row as $user){
echo $user['id'];
}
Возвращает:
Warning: Illegal string offset 'id' in E:\openserv\OpenServer\domains\kolbasa\index.php on line 165
1
Warning: Illegal string offset 'id' in E:\openserv\OpenServer\domains\kolbasa\index.php on line 165
1
Warning: Illegal string offset 'id' in E:\openserv\OpenServer\domains\kolbasa\index.php on line 165
4
Warning: Illegal string offset 'id' in E:\openserv\OpenServer\domains\kolbasa\index.php on line 165
4
Warning: Illegal string offset 'id' in E:\openserv\OpenServer\domains\kolbasa\index.php on line 165
4
Warning: Illegal string offset 'id' in E:\openserv\OpenServer\domains\kolbasa\index.php on line 165
4
Warning: Illegal string offset 'id' in E:\openserv\OpenServer\domains\kolbasa\index.php on line 165
1
Warning: Illegal string offset 'id' in E:\openserv\OpenServer\domains\kolbasa\index.php on line 165
1