includes/dbal.php
changeset 205 62ee6685ad18
parent 165 d53cc29308f4
parent 203 acb9d021b860
child 215 58477ab3937f
equal deleted inserted replaced
185:90b7a52bea45 205:62ee6685ad18
     1 <?php
     1 <?php
     2 
     2 
     3 /*
     3 /*
     4  * Enano - an open-source CMS capable of wiki functions, Drupal-like sidebar blocks, and everything in between
     4  * Enano - an open-source CMS capable of wiki functions, Drupal-like sidebar blocks, and everything in between
     5  * Version 1.1.1
     5  * Version 1.0.2 (Coblynau)
     6  * Copyright (C) 2006-2007 Dan Fuhry
     6  * Copyright (C) 2006-2007 Dan Fuhry
     7  *
     7  *
     8  * This program is Free Software; you can redistribute and/or modify it under the terms of the GNU General Public License
     8  * This program is Free Software; you can redistribute and/or modify it under the terms of the GNU General Public License
     9  * as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
     9  * as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
    10  *
    10  *
   138     unset($dbpasswd); // Security
   138     unset($dbpasswd); // Security
   139     if(!$this->_conn) { dc_here('dbal: uhoh!<br />'.mysql_error()); grinding_halt('Enano is having a problem', '<p>Error: couldn\'t connect to MySQL.<br />'.mysql_error().'</p>'); }
   139     if(!$this->_conn) { dc_here('dbal: uhoh!<br />'.mysql_error()); grinding_halt('Enano is having a problem', '<p>Error: couldn\'t connect to MySQL.<br />'.mysql_error().'</p>'); }
   140     $this->query_backtrace = '';
   140     $this->query_backtrace = '';
   141     $this->num_queries = 0;
   141     $this->num_queries = 0;
   142     dc_here('dbal: we\'re in, selecting database...');
   142     dc_here('dbal: we\'re in, selecting database...');
   143     $q = $this->sql_query('USE '.$dbname.';');
   143     $q = $this->sql_query('USE `'.$dbname.'`;');
   144     if(!$q) $this->_die('The database could not be selected.');
   144     if(!$q) $this->_die('The database could not be selected.');
   145     dc_here('dbal: connected to MySQL');
   145     dc_here('dbal: connected to MySQL');
   146     $this->disable_errorhandler();
   146     $this->disable_errorhandler();
   147   }
   147   }
   148   
   148