I am new to php so please be gentle. I have lookup up solutions within this forum on the exact same problem but am a little confused. I can't seem to figure out why the error
Call to undefined function mysqli_result() in line 10
keeps occurring.
Can anyone help please
<?php
include 'connection.php';
$per_page = 10;
$pages_query = mysqli_query($con,"SELECT COUNT('uniqueID') FROM 'business'");
$pages = mysqli_result($pages_query, 0) / $per_page;
$page = (isset($_GET['page'])) ? (int)$_GET['page'] : 1;
$start = ($page - 1) * $per_page;
$query = mysqli_query($con,"SELECT 'manu' FROM 'business' LIMIT $start $per_page");
while ($query_row = mysqli_fetch_assoc($query)) {
echo '<p>', $query_row['manu'] ,'</p>';
}
?>
Try like this
<?php
include 'connection.php';
$per_page = 10;
$pages_query = mysqli_query($con,"SELECT COUNT('uniqueID') FROM 'business'");
$result = mysqli_fetch_row($pages_query); // <----- added
$pages = $result[0] / $per_page; // <------- modified
$page = (isset($_GET['page'])) ? (int)$_GET['page'] : 1;
$start = ($page - 1) * $per_page;
$query = mysqli_query($con,"SELECT 'manu' FROM 'business' LIMIT $start $per_page");
while ($query_row = mysqli_fetch_assoc($query)) {
echo '<p>', $query_row['manu'] ,'</p>';
}
?>