connect_errno ) {
printf("Connect failed: %s
", $mysqli->connect_error);
exit();
}
printf('Connected successfully.
');
$sql = "SELECT * from gallery";
$result = $mysqli->query($sql);
$i=1;
if ($result->num_rows > 0) {
while($row = $result->fetch_assoc()) {
if($i%1 ==0){ ?>
');
}
mysqli_free_result($result);
$mysqli->close();
?>