Does anyone know how I can do so that the mysqli_fetch_array can read me 3 parameters ?
$registros = 1; //registros por página
$sql = "SELECT * FROM base1";
$result = mysqli_query($conec, $sql);
$reg_total = @mysqli_num_rows($result);
//total de páginas
$pag = ceil($reg_total / $registros);
@mysqli_free_result($result);
if (!isset($_GET['screen']))
$screen = 0;
$position = 0;
$inici = $screen * $registros;
//consulta
$sql = "SELECT * FROM base1 order by ID ASC LIMIT ".$position.",".$registros;
//query
$result = mysqli_query($conec, $sql);
$rows = @mysqli_num_rows($result);
//mostrar registros
for ($i = 0; $i < $rows; $i++) {
$titol = mysqli_fetch_row($result,$i,1);
$video = mysqli_fetch_array($result,$i,2);
echo ("<h1> $titol </h1>");
echo ("<video width='600px' height='400px' controls>
<source src='$video' type='video/mp4'>
</viedo>");
}
//anterior, numero, siguiente
echo '<p><hr></p>
<div style="widht:100%; text-align:center;">';
//registro anterior
if ($position >= 1) {
$url = "cap.php?screen=" .($position-1);
echo "<a href=\"$url\">Anterior</a>\n";
}
//mostrar registro actual
echo '<strong>'.($position+1).' de '.$pag.' <strong>';
//siguiente registro
if ($position < ($pag-1)) {
$url = "cap.php?screen=" . ($position+1);
echo "<a href=\"$url\">Siguiente</a>\n";
}
echo '</div>';
?>
What I want to do is a pagination of only 1 record per page
$registros = 1; //registros por página
$sql = "SELECT * FROM base1";
$result = mysqli_query($conec, $sql);
$reg_total = @mysqli_num_rows($result);
//total de páginas
$pag = ceil($reg_total / $registros);
@mysqli_free_result($result);
if (!isset($_GET['screen']))
$screen = 0;
$position = 0;
$inici = $screen * $registros;
//consulta
$sql = "SELECT * FROM base1 order by ID ASC LIMIT ".$position.",".$registros;
//query
$result = mysqli_query($conec, $sql);
$rows = @mysqli_num_rows($result);
//mostrar registros
for ($i = 0; $i < $rows; $i++) {
$titol = mysqli_fetch_row($result,$i,1);
$video = mysqli_fetch_array($result,$i,2);
echo ("<h1> $titol </h1>");
echo ("<video width='600px' height='400px' controls>
<source src='$video' type='video/mp4'>
</viedo>");
}
//anterior, numero, siguiente
echo '<p><hr></p>
<div style="widht:100%; text-align:center;">';
//registro anterior
if ($position >= 1) {
$url = "cap.php?screen=" .($position-1);
echo "<a href=\"$url\">Anterior</a>\n";
}
//mostrar registro actual
echo '<strong>'.($position+1).' de '.$pag.' <strong>';
//siguiente registro
if ($position < ($pag-1)) {
$url = "cap.php?screen=" . ($position+1);
echo "<a href=\"$url\">Siguiente</a>\n";
}
echo '</div>';
?>