Re: Problem with MDB
| From: | Sonny | Date: | Sat, 06 Sep 2003 20:47:37 +0000 |
| Subject: | Re: Problem with MDB | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-7615@lists.php.net to get a copy of this message | ||
I have found it.
Was an simple permission problem.
----- Original Message -----
From: "Sonny" <sonny2@gmx.de>
To: <pear-general@lists.php.net>
Sent: Saturday, September 06, 2003 9:38 PM
Subject: [PEAR] Problem with MDB
Hello,
I working with PEAR::MDB which working mostly fine.
I don't know why but update,select works fine but delete won't work.
No errormessage comes back, so I don't know why it fails.
Code:
Form the Class:
class SQLmanager {
function SQLmanager() {
require_once 'MDB.php';
$this->db =& MDB::connect( $this->SQLdsn(), $this->_SQLoptions() );
if ( MDB::isError( $this->db ) ) {
MDB::raiseError( "Unable to connect to DB:
$this->db->getMessage() " );
} else {
$this->db->setFetchMode( MDB_FETCHMODE_ASSOC );
$this->db->setErrorHandler( PEAR_ERROR_DIE );
}
}
function SQLooc() {
return $this->db;
}
Instance of the Class:
require 'lib/classes/SQL.php';
$sqlConn =& new SQLmanager();
$my = $sqlConn->SQLooc();
The delete code itself:
$sql1 = $my->prepareQuery("Delete from auth where
id='".$_REQUEST['id']."'");
$my->execute($sql1);
$sql2 = $my->prepareQuery("Delete from users where
uid='".$_REQUEST['id']."'");
$my->execute($sql2);
No error comes back and the data is still in the Database.
Someone an hint for me, why this is not working?
Cheers
-Peter