cvs: pear /DB_DataObject DataObject.php

From: Date: Tue, 18 Jan 2005 01:31:19 +0000
Subject: cvs: pear /DB_DataObject DataObject.php
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-28642@lists.php.net to get a copy of this message
alan_k Mon Jan 17 20:31:19 2005 EDT Modified files: /pear/DB_DataObject DataObject.php Log: make mysqli native for insert http://cvs.php.net/diff.php/pear/DB_DataObject/DataObject.php?r1=1.309&r2=1.310&ty=u Index: pear/DB_DataObject/DataObject.php diff -u pear/DB_DataObject/DataObject.php:1.309 pear/DB_DataObject/DataObject.php:1.310 --- pear/DB_DataObject/DataObject.php:1.309 Sat Dec 11 03:49:42 2004 +++ pear/DB_DataObject/DataObject.php Mon Jan 17 20:31:17 2005 @@ -20,7 +20,7 @@ * @package DB_DataObject * @category DB * - * $Id: DataObject.php,v 1.309 2004/12/11 08:49:42 alan_k Exp $ + * $Id: DataObject.php,v 1.310 2005/01/18 01:31:17 alan_k Exp $ */ /* =========================================================================== @@ -968,10 +968,13 @@ if ($key && $useNative) { switch ($dbtype) { case 'mysql': - $this->$key = mysql_insert_id( + case 'mysqli': + $method = "{$dbtype}_insert_id"; + $this->$key = $method( $_DB_DATAOBJECT['CONNECTIONS'][$this->_database_dsn_md5]->connection ); break; + case 'mssql': // note this is not really thread safe - you should wrapp it with // transactions = eg. @@ -1840,7 +1843,7 @@ // technically postgres native here... // we need to get the new improved tabledata sorted out first. - if ( in_array($dbtype , array( 'mysql', 'mssql')) && + if ( in_array($dbtype , array( 'mysql', 'mysqli', 'mssql')) && ($table[$usekey] & DB_DATAOBJECT_INT) && isset($realkeys[$usekey]) && ($realkeys[$usekey] == 'N') ) {

« previous php.pear.cvs (#28642) next »