PHP Classes

DB Connect: Query a database and fetch the result and metadata

Recommend this page to a friend!
  Info   View files View files (3)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
StarStar 37%Total: 2,089 This week: 1All time: 1,874 This week: 560Up
Version License Categories
db_connect 1.0Public DomainDatabases
Description 

Author

This is a simple class that can connect to a MySQL database, execute an SQL query and retrieve the result set rows and the respective metadata.

The class get function executes an SQL query and returns status of success of the executed query, the number of rows, the number of columns, the total number or result cells, and the list of names of the result columns as part of the result set array. The metadata result fields are prefixed with & to avoid confusion with the result column names.

Depending on the number of rows and columns contained in the result set, it may contain a two dimension array with all the data of the result columns and rows, or just an array with the data of one column or one row, or just one result value.

Picture of Cristian Rusu
Name: Cristian Rusu <contact>
Classes: 2 packages by
Country: Romania Romania
Age: 49
All time rank: 66314 in Romania Romania
Week rank: 411 Up12 in Romania Romania Up

  Files folder image Files  
File Role Description
Accessible without login Plain text file conn_data.inc.php Conf. Used to specify the mySQL connection data
Plain text file db_conn.php Class Class file
Accessible without login Plain text file usage.php Example usage sample

 Version Control Unique User Downloads Download Rankings  
 0%
Total:2,089
This week:1
All time:1,874
This week:560Up
 User Ratings  
 
 All time
Utility:50%StarStarStar
Consistency:62%StarStarStarStar
Documentation:-
Examples:62%StarStarStarStar
Tests:-
Videos:-
Overall:37%StarStar
Rank:3952