Código:
El codigo del php es este:Warning: mysql_query() expects parameter 1 to be string, resource given in /mnt/sda1/arduino/www/rfid/paginacion.php on line 8 Warning: mysql_fetch_array() expects parameter 1 to be resource, null given in /mnt/sda1/arduino/www/rfid/paginacion.php on line 9 'Aún no hay datos que mostrar' < PREV NEXT > Insertar Borrar
Código PHP:
[<html>
<body>
<?php
function mostrar_contenido($min,$max,$conexion){
$result = mysql_query($conexion,"SELECT * FROM usuariosrfid ORDER BY id DESC LIMIT ".$min.",".$max."");
if ($row = mysql_fetch_array($result)){
echo "<table border = '1'>";
echo "<tr> ";
echo "<td><b>id</b></td> ";
echo "<td><b>Nombre</b></td> ";
echo "<td><b>Apellido</b></td> ";
echo "<td><b>Email</b></td> ";
echo "<td><b>RFID</b></td> ";
echo "</tr> ";
do {
echo "<tr> ";
echo "<td>".$row["id"]."</td> ";
echo "<td>".$row["nombre"]."</td> ";
echo "<td>".$row["apellido"]."</td> ";
echo "<td>".$row["correo"]."</td> ";
echo "<td>".$row["rfid"]."</td> ";
echo "<td><a href=modificar.php?id=".$row["id"].">Editar</a></td>";
echo "</tr> ";
} while ($row = mysql_fetch_array($result));
echo "</table>";
echo "</table> ";
} else {
echo "'A..n no hay datos que mostrar'";
}
}
function contar_contenido(){
$result = mysql_query("SELECT * FROM usuariosrfid");
$total = mysql_num_rows($result);
mysql_close();
return $total;
}
$pag = $_GET['pag'];
if(!isset($pag) || empty($pag)){
$min = 0;
$pag = 1;
}else{
if($pag == 1){
$min = 0;
}else{
$min = $maxreg * $pag;
$min = $min - $maxreg;
}
}
$maxreg = 12;
include("class.AutoPagination.php");
include("configuracion.php");
$obj = new AutoPagination(contar_contenido(), $pag);
mostrar_contenido($min,$maxreg,$conexion);
echo $obj->_paginateDetails();
?>
<a href=index.php>Insertar<a>
<br>
<a href=borrar.php>Borrar<a>
</body>