I’m using idiorm as an ORM library and the method as_array() doesn’t work with multiple rows.
$p = $db->find_many()->as_array();
it gives me this error
Fatal error: Call to a member function find_many() on a non-object in
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
According to the idiorm documentation:
So essentially you are trying to call a method on an array, which is not an object, and thus the fatal error. What you need to do if you want to have your rows as arrays, is to loop through each of the
find_many()array items and convert them to array with separateas_array()calls. Or, use the http://lt.php.net/array_map function.