1
0
mirror of https://github.com/e107inc/e107.git synced 2025-07-29 10:50:25 +02:00

Eliminate loop from db_Update so partial field updates are as fast as full updates

This commit is contained in:
mrpete
2007-02-08 22:01:45 +00:00
parent b5d81fef48
commit 4788c48a61

View File

@@ -12,9 +12,9 @@
| GNU General Public License (http://gnu.org). | GNU General Public License (http://gnu.org).
| |
| $Source: /cvs_backup/e107_0.8/e107_handlers/mysql_class.php,v $ | $Source: /cvs_backup/e107_0.8/e107_handlers/mysql_class.php,v $
| $Revision: 1.5 $ | $Revision: 1.6 $
| $Date: 2007-02-07 21:25:11 $ | $Date: 2007-02-08 22:01:45 $
| $Author: e107steved $ | $Author: mrpete $
+----------------------------------------------------------------------------+ +----------------------------------------------------------------------------+
*/ */
@@ -27,8 +27,8 @@ $db_mySQLQueryCount = 0; // Global total number of db object queries (all db's)
* MySQL Abstraction class * MySQL Abstraction class
* *
* @package e107 * @package e107
* @version $Revision: 1.5 $ * @version $Revision: 1.6 $
* @author $Author: e107steved $ * @author $Author: mrpete $
*/ */
class db { class db {
@@ -278,11 +278,8 @@ class db {
$this->mySQLcurTable = $table; $this->mySQLcurTable = $table;
if(is_array($arg)) if(is_array($arg))
{ {
foreach($arg as $k => $v) $keyList= "`".implode("`,`", array_keys($arg))."`";
{ $valList= "'".implode("','", $arg)."'";
$keyList .= ($keyList ? ",`{$k}`" : "`{$k}`");
$valList .= ($valList ? ",'{$v}'" : "'{$v}'");
}
$query = "INSERT INTO `".MPREFIX."{$table}` ({$keyList}) VALUES ({$valList})"; $query = "INSERT INTO `".MPREFIX."{$table}` ({$keyList}) VALUES ({$valList})";
} }
else else