Error ignore removed And fetchAll method enchanted (now with key)

git-svn-id: svn+ssh://code.netmonsters.ru/svn/majestic/trunk@11 4cb57b5f-5bbd-dd11-951b-001d605cbbc5
This commit is contained in:
akulikov
2008-12-03 11:22:33 +00:00
parent 4f6d0bc428
commit 3c08d0f902
2 changed files with 11 additions and 5 deletions

View File

@ -137,11 +137,17 @@ class ModelSelectResult extends ModelResult
return isset($row->$field) ? $row->$field : $default;
}
function fetchAll()
function fetchAll($key = false)
{
$array = array();
while ($row = mysqli_fetch_object($this->result)) {
$array[] = $row;
if ($key) {
while ($row = mysqli_fetch_object($this->result)) {
$array[$row->$key] = $row;
}
} else {
while ($row = mysqli_fetch_object($this->result)) {
$array[] = $row;
}
}
return $array;
}
@ -167,7 +173,7 @@ class ModelChangeResult extends ModelResult
function __construct($resource)
{
$this->affected = mysql_affected_rows($resource);
$this->affected = mysqli_affected_rows($resource);
}
function count()