Etienne Kneuss

home » repository » php » ircbot » libraries » class.DB_mySQL.php
Tree:
school
mp3
php
sample
publications
Math_Derivative
Math_Expression
ircbot
libraries
class.Link_IRC.php
class.DB_mySQL.php
class.Link.php
expt.DB_Exception.php
class.DB_mySQL_Results.php
class.DB_Common_Results.php
class.DB.php
class.DB_Common.php
iface.Observed.php
iface.Observer.php
class.BaseArray.php
class.Bot.php
modules
exceptions
bot.php
plopbot.sql
php.net
images
dump

Source code raw phps

    <?php require_once 'libraries/class.DB_Common.php'; require_once 'libraries/class.DB_mySQL_Results.php'; class DB_mySQL extends DB_Common {     protected $_link;     protected $_resources = array(null);               public function __cosntruct() {     }          public function connect($host, $username, $password, $database)     {         $this->_link = mysql_connect($host, $username, $password);         if (!$this->_link) {             $this->notify('Can\'t connect', Bot::U_ERROR | Bot::U_DB);         } else {             $this->notify('Connected to the server!', Bot::U_DEBUG | Bot::U_DB);         }         $selected = mysql_select_db($database, $this->_link);         if (!$selected) {             $this->notify('Unable to select a database', Bot::U_ERROR | Bot::U_DB);         } else {             $this->notify('Selected the database '.$database, Bot::U_DEBUG | Bot::U_DB);         }     }          public function execute($query)     {         $resource = mysql_query($query, $this->_link);         if (!$resource) {             $this->notify('SQL query failed : '.mysql_error($this->_link) .' The query was: '.$query, Bot::U_ERROR | Bot::U_DB);         } else {             $this->notify('SQL query executed: "'.$query.'"', Bot::U_DEBUG | Bot::U_DB);         }         if (is_resource($resource)) {             return new DB_mySQL_Results($resource);         } else {             return $resource;         }              }          public function insertedId()     {         return mysql_insert_id();     }     public function escape($value)     {         return mysql_real_escape_string($value);     } } ?>

Comments

There is currently no comment here.

Add a comment

Username:

Spam Challenge: 5+15=?

Comment: