Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Simple MySQL class written in PHP, for interfacing with a MySQL database.
PHP
tree: 75635aa3a0

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
COPYING
README
class.MySQL.php
readme.textile

readme.textile

License

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.

Setup

Simply include this class into your project like so:

include_once('/path/to/class.MySQL.php');

Then make sure you have the following definitions set:

MYSQL_HOST
MYSQL_USER
MYSQL_PASS
MYSQL_NAME

I usually include them in a globally included config file.

MYSQL_HOST = The hostname of the MySQL server (usually, but not always, ‘localhost’).

MYSQL_USER = Your username for the server / database

MYSQL_PASS = Your password for the server / database

MYSQL_NAME = The name of your database

Usage

To use this class, you’d first init the object like so:

$oMySQL = new MySQL();

The class constructor will perform a connection to the database automatically. To execute statements simply use:

$oMySQL->ExecuteSQL($query);
Something went wrong with that request. Please try again.