This is my code:
<?php
function result($conn) {
global $number;
$sql = 'SELECT movie_name FROM movie_info LIMIT 3 OFFSET 0';
foreach ($conn->query($sql) as $row) {
print " ". $row['movie_name'] . " <br> ";
}
}
result($conn);
?>
I am really confused, how to count the number of rows in the table and print it?