$link = new mysqli($servername, $username, $password, $dbname);
$result = mysqli_query($link, "SELECT * FROM mytable");
if ($result)
echo 'ok'
$result = mysqli_query($link, "SELECT * FROM mytable");
if ($result) {
echo "ok";
while ($row = mysqli_fetch_assoc($result)) {
print_r($row);
}
}