PHP Classes

Arrays from database: I need arrays from a database ; also json format

Recommend this page to a friend!
  All requests RSS feed  >  Arrays from database  >  Request new recommendation  >  A request is featured when there is no good recommended package on the site when it is posted. Featured requests  >  No recommendations No recommendations  

Arrays from database

Edit

Picture of marcelo benitez by marcelo benitez - 10 years ago (2015-03-01)

I need arrays from a database ; also json format

This request is clear and relevant.
This request is not clear or is not relevant.

+6

I need to extract rows from a database in array format

  • 1 Clarification request
  • 1. Picture of Manuel Lemos by Manuel Lemos - 10 years ago (2015-03-04) Reply

    What database are you using? Is it MySQL or something else?

    Ask clarification

    2 Recommendations

    Ultimate MySQL: MySQL database access wrapper

    This class is the ultimate MySQL database access wrapper

    It can:

    - Establish MySQL server connections
    - Execute SQL queries
    - Query a single value or a single row
    - Retrieve query results into arrays or resource objects
    - Retrieve the last inserted ID
    - Manage transactions (transaction processing)
    - Retrieve the list tables of a database
    - Retrieve the list fields of a table
    - Retrieve the length or position of a field
    - Measure the time a query takes to execute
    - Display query results in an HTML table
    - Format SQL parameters (safe against SQL injection hacks)
    - Generate SQL
    - Handle errors (optional Exception handling)
    - Convert records into XML or JSON
    - Uses the mysqli extension
    This recommendation solves the problem.
    This recommendation does not solve the problem.

    +3

    Picture of Manuel Lemos by Manuel Lemos Reputation 26695 - 9 years ago (2015-05-08) Comment

    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. 


    Database Manager: Connect and query several databases using PDO

    This package connect and Query several databases using PDO.

    There is a base class that can establish connections to different databases using PDO. Currently it supports MySQL, PostgreSQL, SQL Server and SQLite.

    The query sub-class extends the connection class can execute arbitrary queries and retrieve the results as an array or a string.
    This recommendation solves the problem.
    This recommendation does not solve the problem.

    +6

    Picture of Samuel Adeshina by Samuel Adeshina package author package author Reputation 1015 - 9 years ago (2015-05-07) Comment

    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


    Recommend package
    : 
    :