
12/09/2008, 08:56
|
 | | | Fecha de Ingreso: junio-2007 Ubicación: Shikasta
Mensajes: 1.272
Antigüedad: 17 años, 9 meses Puntos: 49 | |
Respuesta: Buscador con Paginator Que tal ealaequis, en concreto cual es el error que te arroja? sin embargo prueba así tu código: Código PHP: <?php
$conexion = mysql_connect('localhost', 'root', '???') or die (mysql_error());
mysql_select_db('ediciones',$conexion) or die (mysql_error());
if (isset($_POST['txtBusqueda'])) {
$busqueda = $_POST['txtBusqueda'];
$_pagi_sql = "SELECT * FROM libros WHERE esp_nombre LIKE '% $busqueda%' or autor LIKE '%$busqueda%' or esp_rese LIKE '%$busqueda%' ORDER BY esp_nombre ASC";
} else {
$_pagi_sql = "SELECT * FROM libros ORDER BY esp_nombre ASC";
}
// No es necesario incluir el cursor ya que el paginador ejecuta automaticamente la consulta
//$result = mysql_query($_pagi_sql) or die (mysql_error());
$_pagi_cuantos = 10;
include("paginator.inc.php");
$resu = mysql_num_rows($_pagi_result);
?>
<table width="940" border="0" align="center" cellpadding="00" cellspacing="0">
<tr>
<td bgcolor="#99FF99"><div align="center" class="Estilo12">
</div>
</table>
<?php
while ($registro = mysql_fetch_array($_pagi_result)) {
?>
</p>
<table width="940" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="100" rowspan="3" bgcolor="#66FFCC"><div align="center"><img src="../miniaturas-en-edicion/<?php echo $registro['tapa']; ?>" width="65" height="100" border="0"></a></div></td>
<td height="26" colspan="2" valign="top" bgcolor="#66FFCC"><span class="Subtitulo"><strong><?php echo $registro['esp_nombre']; ?> - <?php echo $registro['cod']; ?><br>
<span class="autor"><?php echo $registro['autor']; ?></span></td>
</tr>
<tr>
<td height="51" colspan="2" valign="middle" bgcolor="#66FFCC"><p><?php echo $registro['esp_rese']; ?>... <a href='librosamp.php?cod=<?php echo $registro['id']; ?>' >» AMPLIAR</a></a></p></td>
</tr>
<tr>
<td width="82%" height="20" valign="middle" bgcolor="#66FFCC">PRECIO <span class="Estilo3">u$s</span><?php echo $registro['precio']; ?> <span class="Estilo3">peso</span> <?php echo $registro['peso']; ?></td>
<td width="8%" height="20" valign="middle" bgcolor="#66FFCC"><div align="right"><a href="formulario.htm">ENCARGAR</a></div></td>
</tr>
<tr>
<td height="16" colspan="3" bgcolor="#66FFCC"><div align="center"><img src="../linea-divisora.jpg" width="763" height="2"></div></td>
</tr>
<?php
}
?>
</table>
<table width="940" border="0" align="center" cellpadding="00" cellspacing="0">
<tr>
<td bgcolor="#99FF99"><div align="center" class="Estilo12">
<?php
echo"<p>".$_pagi_navegacion."</p>";
?>
</div></td>
</tr>
</table>
<table width="940" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td bgcolor="#99CC66"><div align="center">Resultados de la búsqueda:
<?php
echo $resu;
mysql_close($conexion);
?>
</div></td>
</tr>
</table> Saludos. |