GitHub - nimto/PHP-MySQL-Database-Class: A singleton pattern object which serves as a MySQL database wrapper and an iterator result set object. | Latest TMZ Celebrity News & Gossip | Watch TMZ Live
Skip to content

nimto/PHP-MySQL-Database-Class

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

PHP MySQL Database Class
========================

Copyright (c) 2011 Micah Carrick
All Rights Reserved.

PHP MySQL Database Class is singleton pattern object which serves as a MySQL 
database wrapper and an iterator result set object. This project was developed
as a follow up to my older, PHP4 database class from 2004.


Basic Usage
-----------
For a more detailed explanation, consult the phpDocumentor docstrings within
the source code or visit http://www.micahcarrick.com/php5-mysql-database-class.html

Here are some simple examples:

// get the database singleton instance
$db = MySqlDatabase::getInstance();

// connect
try {
    $db->connect('localhost', 'username', 'password', 'database_name');
} 
catch (Exception $e) {
    die($e->getMessage());
}

// iterate a resultset
foreach ($db->iterate("SELECT foo FROM bar LIMIT 10") as $row) {
    echo $row->foo;
}

// get just one row
$count = $db->fetchOne("SELECT COUNT(*) FROM foo");

// import from a file (use with caution!)
$num = $db->importSqlFile('test-data.sql');
echo "Imported <strong>$num</strong> statements.<br/>";

About

A singleton pattern object which serves as a MySQL database wrapper and an iterator result set object.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

TMZ Celebrity News – Breaking Stories, Videos & Gossip

Looking for the latest TMZ celebrity news? You've come to the right place. From shocking Hollywood scandals to exclusive videos, TMZ delivers it all in real time.

Whether it’s a red carpet slip-up, a viral paparazzi moment, or a legal drama involving your favorite stars, TMZ news is always first to break the story. Stay in the loop with daily updates, insider tips, and jaw-dropping photos.

🎥 Watch TMZ Live

TMZ Live brings you daily celebrity news and interviews straight from the TMZ newsroom. Don’t miss a beat—watch now and see what’s trending in Hollywood.