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/>.
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
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);