Recommend this page to a friend! |
Download .zip |
Info | Example | View files (5) | Download .zip | Reputation | Support forum (1) | Blog (1) | Links |
Ratings | Unique User Downloads | Download Rankings | ||||
35% | Total: 524 | All time: 5,641 This week: 181 |
Version | License | PHP version | Categories | |||
php-simple-db-class 1.0.0 | GNU General Publi... | 5 | PHP 5, Databases |
Description | Author | ||||||||||||||
This class can connect and query a MySQL database. Recommendations mysql database |
|
OOP Database class for PHP MySQL connection and insert, update, delete and select query
All database configurations are stored in seperate config.ini.php file, which can be kept off document root.
Database class loads configuration file and establishes a MySQLi connect in constructor so just creating an instance of class connects you with database.
e.g:
$db = new MySQLDb; // would connect to database
To run any kind of query (select, insert, update, delete), pass SQL query to query method of class
e.g:
$query = "select * from table_name";
$result = $db->query($query); //$result object returns true on successful execution
To select rows after executing query, use fetch() method and store result in an array
e.g:
$rows = $db->fetch();
examples.php has a create table SQL to create a test table and load some data in it
Examples includes quering database, checking result object and examples of select, insert, update and delete queries.
Files |
File | Role | Description |
---|---|---|
config.ini.php | Conf. | Configuration script |
database.class.php | Class | Class source |
example.php | Example | Example script |
LICENSE | Lic. | License text |
README.md | Doc. | Documentation |
php-simple-db-class-2017-06-03.zip 15KB | |
php-simple-db-class-2017-06-03.tar.gz 14KB | |
Install with Composer |
Version Control | Unique User Downloads | Download Rankings | |||||||||||||||
100% |
|
|
User Ratings | User Comments (5) | ||||||||||||||||||||||||||||||||||||||||||||||
|
|
Applications that use this package |
If you know an application of this package, send a message to the author to add a link here.