Get all objects without loop in OOP MySQLi

后端 未结 2 1501
遇见更好的自我
遇见更好的自我 2021-01-18 20:57

This is how I get one record with MySQLi:

$result = $db->query(\"...\");
$image = $result->fetch_object();

Now I need to get the comm

2条回答
  •  难免孤独
    2021-01-18 21:31

    Yes. The mysqli_result class provides a fetch_all method to do this. However, that method will only return associative or numeric arrays (or a hybrid), not objects.

提交回复
热议问题