Next row function in php
702
<?php
include "../conf/db-connect.php";
$res=mysqli_query($conn,"SELECT * FROM `main` WHERE `ribilleder` = 1 and
`rtbilleder` = 0");
?>
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Untitled Page</title>
<link href="Rettelse_til_Billeder.css" rel="stylesheet">
<link href="index.css" rel="stylesheet">
</head>
<body>
<?php
if($_GET){
if(isset($_GET['nrettelse'])){
Nextrettelse();
}elseif(isset($_GET['frettelse'])){
Prevusrettelse();
}
}
function Prevusrettelse()
{
}
function Nextrettelse()
{
}
?>
<form >
<?php
while($row=mysqli_fetch_array($res))
{
?>
how to get next row in the database, I have tried with a function$res->movenext()
, but get an error.
In Access the function is call docmd.GoTo, is there the same function I PHP?
Can someone help me?
Answer
Solution:
I think you can try to store the entire record set inside of an array and then by using an index you can print out the next row or the previous one
For example