fetch_array with 3 parameters?

0

I was doing a pagination to show one by one the records of a bd but to show the data with the fetch_array it only lets me put two parameters. How can I fix it?

$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_array($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>';

?>
    
asked by DarkSpace 05.08.2018 в 18:09
source

0 answers