- <?php
-
- /**
- * sptpl_db_mysql.php
- *
- * Mysql access module
- *
- * require: sptpl_db.php
- *
- * @copyright sptpl_db_mysql.php is part of Sptpl project {@link http://www.andrioli.com/en/sptpl.html} and it is LGPL
- * @author Andrioli Darvin <darvin (inside) andrioli (dot) com>
- * @version $Header: d:\cvs/classistd/sptpl/sptpl_db_mysql.php,v 2.1 2005/03/02 21:00:54 Darvin Exp $
- */
- /*
- * +-------------------------------------------------------------------------+
- * | Sptpl |
- * +-------------------------------------------------------------------------+
- * | Copyright (c) 2003-2005 Andrioli Darvin |
- * | Email <darvin (inside) andrioli (dot) com> |
- * | Web http://www.andrioli.com/en/sptpl.html |
- * | Download http://www.phpclasses.org/browse.html/package/1326.html |
- * | |
- * +-------------------------------------------------------------------------+
- * | This library is free software; you can redistribute it and/or modify |
- * | it under the terms of the GNU Lesser General Public License as |
- * | published by the Free Software Foundation; either version 2 of the |
- * | License, or (at your option) any later version. |
- * | |
- * | This library 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 |
- * | Lesser General Public License for more details. |
- * | |
- * | You should have received a copy of the GNU Lesser General Public |
- * | License along with this library; if not, write to the Free Software |
- * | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
- * +-------------------------------------------------------------------------+
- */
-
-
- class db_mysql extends CDB {
-
- function db_mysql()
- {
- }
-
- function DbOpen($DBSystem,$DBUser,$DBPasswd,$DBName)
- {
- if(($this->DbConn=mysql_connect($DBSystem,$DBUser,$DBPasswd))===FALSE)
- {
- // Errore di select del db
- trigger_error("Error during connection to the server ".$DBSystem,E_USER_ERROR);
- }
- if(!mysql_select_db($DBName,$this->DbConn))
- {
- // Errore di select del db
- trigger_error("I cannot select the db ".$DBName,E_USER_ERROR);
- }
- }
-
- function DbExecSql($sql)
- {
- if(($this->DbResult=mysql_query($sql))===FALSE)
- {
- // Errore di select del db
- trigger_error("Error into sql statement. Sql string: ".$sql.".Err:". mysql_errno() . ": " . mysql_error());
- }
- // ToTrace($sql);
- return(TRUE);
- }
-
- function DbGetValue()
- {
- // ToTrace("Prima ".$GLOBALS['debug']->Dump($this->DbValue));
- return(mysql_fetch_array($this->DbResult));
- // ToTrace("Dopo ".$GLOBALS['debug']->Dump($this->DbValue));
- // MyDebug(mysql_fetch_array($this->DbResult));
-
- }
-
- function DbClose()
- {
- mysql_close($this->DbConn);
- }
-
- }
- ?>