|All requests||>||Arrays from database||>||Request new recommendation||>||Featured requests||>||No recommendations|
by marcelo benitez - 4 years ago (2015-03-01)
I need to extract rows from a database in array format
1. by Manuel Lemos - 4 years ago (2015-03-04) Reply
What database are you using? Is it MySQL or something else?
I think most MySQL database access classes can return results in arrays. If you need the results in JSON format, it is just a matter of using json_encode.
Anyway, this class can already return the results in JSON format already.
It also uses the MySQLi extension, so it will work in newer PHP versions.
Try out this class. It returns the result of a query as an array. The catch is that, the class is database-independent. It can work with a mysql, sql server, sqlite or even pgresql database