Softpedia
 


SCRIPTS CATEGORIES:



NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
MEET THE EDITORS >>
WEEK'S BEST
  • Koken 0.8.4
  • ContentBox 1.5.2
  • jQPlayer 0.5.2
  • SPOILER ALERT! 0.0.2
  • jQuery Mask Plugin 0.9.0
  • Easing Slider 2.1.2
  • Btapp.js 0.2.0
  • WiiFlash 0.4.5
  • Breeze.js 1.3.3
  • TinyMCE Templates 3.0.2
  • Home > Scripts > PHP Classes

    MySQL Database Abstraction 2.0

    download button


    Downloads: 1,587  Tell us about an update
    User Rating:
    Rated by:
    Fair (2.8/5)
    18 user(s)
    Developer:

    Website:

    License / Price:

    Platforms:

    Databases:

    Language:

    Last Updated:

    Category:
    Jon Abernathy | More scripts
    www.chuggnutt.com
    GPL - GNU General Public License 

    Windows / Linux / Mac OS / BSD / Solaris
    N/A
    PHP
    July 18th, 2008, 08:27 GMT
    C: \ PHP Classes

     Read user reviews (0)  Refer to a friend  Subscribe

    MySQL Database Abstraction description

    This PHP class provides an abstraction layer for MySQL.

    This PHP class provides an abstraction layer for MySQL.

    The main purpose is to encapsulate and simplify the details of connecting to a MySQL database and performing queries.

    This class is for  MySQL only  is designed for a single database; to use it, extend the class in your code, with the given database/user/password you will connect to.

    Usage

     

    // Include the class definition file.
    require_once('class.db.inc');

    // Extend the class with your own database parameters
    class DB_Mysql extends DB {
        var $host = 'host.db.com';
        var $database = 'dbname';
        var $user = 'username';
        var $password = 'password';
    }

    // Instantiate the class
    $db =& new DB_Mysql;

    // Run a SQL query
    $db->query('SELECT * FROM table');

    // Iterate through the result set (if any)
    while ( $db->next_record() ) {
        // Retrieve the value for a particular field in the current row
        $field = $db->f('field');
        // etc...
    }

    ?>



    TAGS:

    connect to database | mysql connection | php mysql connect | database | connect | mysql

    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

    SUBMIT PROGRAM   |   ADVERTISE   |   GET HELP   |   SEND US FEEDBACK   |   RSS FEEDS   |   UPDATE YOUR SOFTWARE   |   ROMANIAN FORUM