-
Bug
-
Resolution: Fixed
-
3.0.x
-
None
-
PHP Environment:
Database:
$db->sql_multi_insert currently contains this code, moved from $db->sql_build_array():
// If by accident the sql array is only one-dimensional we build a normal insert statement if (!is_array($_sql_ary)) { $query = $this->sql_build_array('INSERT', $sql_ary); break; }
|
The problem is that sql_multi_insert doesn't use $query, so this can't work. I have two proposals:
1. Replacing this code with:
// If by accident the sql array is only one-dimensional we build a normal insert statement if (!is_array($_sql_ary)) { $this->sql_query('INSERT INTO ' . $table . ' ' . $this->sql_build_array('INSERT', $sql_ary)); return true; }
|
2. Dropping this bad use of API and replacing code with:
// If by accident the sql array is only one-dimensional we _stop working_ - no accidents please! if (!is_array($_sql_ary)) { trigger_error('$db->sql_multi_insert() was executed with one-dimensional $sql_ary.', E_USER_ERROR); }
|
Maybe it's good idea to commit a 1st solution to 3.0 and 2nd to trunk?