baglan.php
$databaseHost = 'localhost';
$databaseName = 'ilkokul';
$databaseUsername = 'root';
$databasePassword = '';
$mysqli = mysqli_connect($databaseHost, $databaseUsername, $databasePassword, $databaseName);
index.php
1. ve 10. satırda hata veriyor
$result = mysqli_query($mysqli, "SELECT * FROM biron ORDER BY id DESC");
while($row = mysqli_fetch_array($result)) {
echo ''.$row['oku'].' ';
echo "
";
}
?>
goster.php
require_once("baglan.php");
$id = $_GET['id'];
?>
Previous and Next page buttons in PHP website with MYSQL database
$result = mysqli_query($mysqli, "SELECT * FROM biron WHERE id=$id");
if($row = mysqli_fetch_array($result))
{
$title = $row['sayi'];
$content = $row['oku'];
}
?>
// Next button
$next = mysqli_query($mysqli, "SELECT * FROM biron WHERE id>$id order by id ASC");
if($row = mysqli_fetch_array($next))
{
echo '';
}
// Previous button
$previous= mysqli_query($mysqli, "SELECT * FROM biron WHERE id<$id order by id DESC");
if($row = mysqli_fetch_array($previous))
{
echo '';
}
?>