public QuerySingleRowArray ( string $sql, integer $resultType = MYSQLI_BOTH ) : array | ||
$sql | string | The query string should not end with a semicolon |
$resultType | integer | (Optional) The type of array Values can be: MYSQLI_ASSOC, MYSQLI_NUM, MYSQLI_BOTH |
return | array | An array containing the first row or FALSE if no row is returned from the query |
public function QuerySingleRowArray($sql, $resultType = MYSQLI_BOTH)
{
$this->Query($sql);
if ($this->RowCount() > 0) {
return $this->RowArray(null, $resultType);
} else {
return false;
}
}
public function lastCaller() { $db = new MySQL(true, 'color64', 'localhost', 'color64', 'nu5Jc4JdtZK4RCHH'); $caller = $db->QuerySingleRowArray('SELECT `user_name` FROM `log` ORDER BY `id` DESC LIMIT 0,1'); return $caller['user_name']; }