PHP Classes
elePHPant
Icontem

IDatabase class: MySQL Database access wrapper using MySQLi

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Info   View files View files (5)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Last Updated Ratings Unique User Downloads Download Rankings  
2014-03-06 (1 year ago) RSS 2.0 feedNot yet rated by the usersTotal: 200 All time: 7,469 This week: 1,184Up
Version License PHP version Categories  
idatabase-class 1.0GNU General Publi...5PHP 5, Databases
Description Author  

This class is a MySQL Database access wrapper using MySQLi. It can:

- Connect to a MySQL server
- Get MySQL server statistics
- Execute a SELECT SQL query and return all the results into an array
- Execute SQL INSERT, UPDATE and DELETE queries given the SQL query
- Execute SQL INSERT or UPDATE queries given the table name, the list of field names and values
- Get the number of records in a table that match a given condition
- Get a single field or a single row of a table that matches a condition

Picture of Nemeth Zoltan
Name: Nemeth Zoltan <contact>
Classes: 4 packages by
Country: Hungary Hungary
Age: 37
All time rank: 219921 in Hungary Hungary
Week rank: 861 Up7 in Hungary Hungary Up

Details provided by the author  
URGENT!
 > First you need change the database access data in IDatabase.class.php line 14 to 17!

-- Sample MySQL table

CREATE TABLE IF NOT EXISTS `sample` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `name` varchar(255) NOT NULL,
  `counter` int(11) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;

INSERT INTO `sample` (`id`, `date`, `name`, `counter`) VALUES
(1, '2014-03-06 15:45:11', 'test1', 0),
(2, '2014-03-06 15:45:16', 'test2', 0),
(3, '2014-03-06 15:45:21', 'tester1', 0),
(4, '2014-03-06 15:45:27', 'tester2', 0),
(5, '2014-03-06 15:45:34', 'tester3', 0);
  Files folder image Files  
File Role Description
Plain text file EException.class.php Class The exception class for IDatabase class
Plain text file IDatabase.class.php Class The base class file
Accessible without login Plain text file index.php Example Example script fro IDatabase class use
Accessible without login Plain text file readme.txt Doc. Sample table create script for example
Accessible without login Plain text file sample_output.txt Output Sample output

 Version Control Reuses Unique User Downloads Download Rankings  
 0%1Total:200All time:7,469
 This week:0This week:1,184Up