Recommend this page to a friend! |
Download |
Info | Example | Files | Install with Composer | Download | Reputation | Support forum | Blog | Links |
Ratings | Unique User Downloads | Download Rankings | ||||
35% | Total: 604 This week: 1 | All time: 5,172 This week: 34 |
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. |
|
mysql database
script for update mysql database
<?php |
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 (5) |
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 |
The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page. |
Install with Composer |
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.