PHP Classes
Icontem

Class: Bobo PHP DB Class


  Search   All class groups All class groups   Latest entries Latest entries   Top 10 charts Top 10 charts   Newsletter Newsletter   Blog Blog   Forums Forums   Help FAQ Help FAQ  
  Login   Register  
Recommend this page to a friend! ReTweet ReTweet Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of JImmy Bo  >  Bobo PHP DB Class  >  Download  >  Support forum Support forum  >  Blog Blog  >  RSS 1.0 feed RSS 2.0 feed Latest changes  
Name: Bobo PHP DB Class Support forum
Base name: bobophpdb
Description: Simple MySQL database access wrapper
Version: 1
Required PHP version: 4
License: Freely Distributable
All time users: 263 users
All time rank: 4515
Week users: 0 users
Week rank: 3621
 
  Author   Group folder image Groups   Detailed description  
  Rate classes User ratings   Applications   Files Files  

Author

Picture of JImmy Bo
Name: JImmy Bo <e-mail contact>
Published packages: 2 Browse this author's classes Browse this author's classes
Country: Canada Canada - PHP jobs in Canada
Home page: http://hexmud.com/
Age: ???
All time rank: 1991
Week rank: 1467

Groups

Group folder image Databases Database management, accessing and searching View top rated classes

Detailed description

This class simplifies connections to a MySQL database.

Connections are automatically created if they are not already connected on the first query (meaning a connect statement is not required).

The class can also retrieve the identifier of the last inserted record, and check whether a given table exists. A query can return data into an array, a single variable, or just return the id of the last insert (get,row,q respectively). Script can manually be told to open or close the connection (connect or close respectively).

More information on how to use this class is available in the class source code.

* example usage:
*
* 1) create a file called inc.config.php in it throw this:
* // include the class:
* include_once('class.db.php');
* // set the variables:
* $db_host = "localhost";
* $db_user = "myusername";
* $db_pass = "mypassword";
* $db_name = "mydatabasename";
* // make a db object:
* $db = new mydb($db_host, $db_user, $db_pass, $db_name);
*
* 2) now in your file that you want to access the db from just include_once('inc.config.php');
* don't worry it won't connect till it's first query and it does so automagically.
*
* 3) some example usage:
* // an insert
* $SQL = "INSERT INTO addressbook (name) VALUES ('bob')";
* $insertid = $db->q($SQL); // returns false if no insertid or the id
* echo $insertid;
*
* // a single row returned
* $SQL = "SELECT * FROM addressbook WHERE name LIKE 'bob' LIMIT 1";
* $row = $db->row($SQL);
* echo $row['name'];
*
* // multiple rows returned
* $SQL = "SELECT * FROM addressbook";
* $addresses = $db->get($SQL);
* foreach($addresses AS $address)
* echo $address['name'];
*
* // prematurely open
* $db->connect();
* // prematurely close
* $db->close(); // will reopen automatically if needed again
*

latest version:
* - changed safe text so it uses proper mysql function
* - added function error to store errors
* - added function show_errors to display the errors
* - added function update_array (example at bottom of this script)
* - added function insert_array (example at bottom of this script)

User ratings

There are not enough user ratings to display for this class.

Applications that use this class

No application links were specified for this class.
Add link image If you know an application of this package, send a message to the author to add a link here.

Files

File Role Description
Accessible without login Plain text file class.db.php Class The class file for Bobo's PHP DB Class
Accessible without login Plain text file inc.config.php Example example config include file
Download all files: bobophpdb.tar.gz bobophpdb.zip
NOTICE: if you are using a download manager program like 'GetRight', please Login before trying to download this archive.

 
  Advertise on this site Advertise on this site   Site map Site map   Statistics Statistics   Site tips Site tips   Privacy policy Privacy policy   Contact Contact  

For more information send a message to :
info at phpclasses dot org.
Copyright (c) Icontem 1999-2009 PHP Classes - PHP Class Scripts
  PHP Book Reviews - Reviews of books and other products