public function get_row($query = null, $output = OBJECT, $y = 0)
{
$this->func_call = "\$db->get_row(\"{$query}\",{$output},{$y})";
if ($query) {
$this->query($query);
} else {
return null;
}
if (!isset($this->last_result[$y])) {
return null;
}
if ($output == OBJECT) {
return $this->last_result[$y] ? $this->last_result[$y] : null;
} elseif ($output == ARRAY_A) {
return $this->last_result[$y] ? get_object_vars($this->last_result[$y]) : null;
} elseif ($output == ARRAY_N) {
return $this->last_result[$y] ? array_values(get_object_vars($this->last_result[$y])) : null;
} elseif (strtoupper($output) === OBJECT) {
// Back compat for OBJECT being previously case insensitive.
return $this->last_result[$y] ? $this->last_result[$y] : null;
} else {
$this->print_error(" \$db->get_row(string query, output type, int offset) -- Output type must be one of: OBJECT, ARRAY_A, ARRAY_N");
}
}