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:
@ -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()
|
||||
|
Reference in New Issue
Block a user