|
| 1 | +h3. License |
| 2 | + |
| 3 | + |
| 4 | +This program is free software: you can redistribute it and/or modify |
| 5 | +it under the terms of the GNU General Public License as published by |
| 6 | +the Free Software Foundation, either version 3 of the License, or |
| 7 | +(at your option) any later version. |
| 8 | + |
| 9 | +This program is distributed in the hope that it will be useful, |
| 10 | +but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 | +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 12 | +GNU General Public License for more details. |
| 13 | + |
| 14 | +You should have received a copy of the GNU General Public License |
| 15 | +along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 16 | + |
| 17 | +h3. SETUP |
| 18 | + |
| 19 | +Simply include this class into your project like so: |
| 20 | + |
| 21 | +bc. include_once('/path/to/class.MySQL.php'); |
| 22 | + |
| 23 | +Then make sure you have the following definitions set: |
| 24 | + |
| 25 | +bc. MYSQL_HOST |
| 26 | +MYSQL_USER |
| 27 | +MYSQL_PASS |
| 28 | +MYSQL_NAME |
| 29 | + |
| 30 | +I usually include them in a globally included config file. |
| 31 | + |
| 32 | +@MYSQL_HOST@ = The hostname of the MySQL server (usually, but not always, 'localhost'). |
| 33 | + |
| 34 | +@MYSQL_USER@ = Your username for the server / database |
| 35 | + |
| 36 | +@MYSQL_PASS@ = Your password for the server / database |
| 37 | + |
| 38 | +@MYSQL_NAME@ = The name of your database |
| 39 | + |
| 40 | +h3. USAGE |
| 41 | + |
| 42 | + |
| 43 | +To use this class, you'd first init the object like so: |
| 44 | + |
| 45 | +bc. $oMySQL = new MySQL(); |
| 46 | + |
| 47 | +The class constructor will perform a connection to the database automatically. To execute statements simply use: |
| 48 | + |
| 49 | +bc. $oMySQL->ExecuteSQL($query); |
| 50 | + |
0 commit comments