query("SELECT * FROM items ORDER BY id ASC"); $ret = array(); while ($row = $res->fetch_assoc()) { $ret[] = $row; } return $ret; } if (!auth()) { header('WWW-Authenticate: Basic realm="C3CLOC"'); header('HTTP/1.0 401 Unauthorized'); exit; } else { ?>