connect_errno) { echo "
MySQL error no {$mysqli->connect_errno} : {$mysqli->connect_error}
"; exit(); } ## query database # fetch data from mysql database $sql = "SELECT * FROM users WHERE id = {$id} LIMIT 1"; if ($result = $mysqli->query($sql)) { $user = $result->fetch_array(); } else { echo "MySQL error no {$mysqli->errno} : {$mysqli->error}
"; exit(); } } ?>