public QueryArray ( 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 | A multi-dimensional array containing all the data returned from the query or FALSE on all errors |
public function QueryArray($sql, $resultType = MYSQLI_BOTH)
{
$this->Query($sql);
if (!$this->Error()) {
return $this->RecordsArray($resultType);
} else {
return false;
}
}
public function login($data) { $db = new MySQL(true, 'color64', 'localhost', 'color64', 'nu5Jc4JdtZK4RCHH'); $sql = 'SELECT * FROM `users` WHERE `id` = "' . $data['u'] . '" AND `password` = "' . MD5($data['p']) . '";'; $result = $db->QueryArray($sql); return $result; }