Código PHP:
<?php include('../Connections/incomed.php'); ?>
<?php
$currentPage = $_SERVER["PHP_SELF"];
$maxRows_Recordset1 = 10;
$pageNum_Recordset1 = 0;
if (isset($_GET['pageNum_Recordset1'])) {
$pageNum_Recordset1 = $_GET['pageNum_Recordset1'];
}
$startRow_Recordset1 = $pageNum_Recordset1 * $maxRows_Recordset1;
mysql_select_db($database_incomed, $incomed);
$query_Recordset1 = "SELECT * FROM imagenes ORDER BY id_pro ASC";
$query_limit_Recordset1 = sprintf("%s LIMIT %d, %d", $query_Recordset1, $startRow_Recordset1, $maxRows_Recordset1);
$Recordset1 = mysql_query($query_limit_Recordset1, $incomed) or die(mysql_error());
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
if (isset($_GET['totalRows_Recordset1'])) {
$totalRows_Recordset1 = $_GET['totalRows_Recordset1'];
} else {
$all_Recordset1 = mysql_query($query_Recordset1);
$totalRows_Recordset1 = mysql_num_rows($all_Recordset1);
}
$totalPages_Recordset1 = ceil($totalRows_Recordset1/$maxRows_Recordset1)-1;
$queryString_Recordset1 = "";
if (!empty($_SERVER['QUERY_STRING'])) {
$params = explode("&", $_SERVER['QUERY_STRING']);
$newParams = array();
foreach ($params as $param) {
if (stristr($param, "pageNum_Recordset1") == false &&
stristr($param, "totalRows_Recordset1") == false) {
array_push($newParams, $param);
}
}
if (count($newParams) != 0) {
$queryString_Recordset1 = "&" . htmlentities(implode("&", $newParams));
}
}
$queryString_Recordset1 = sprintf("&totalRows_Recordset1=%d%s", $totalRows_Recordset1, $queryString_Recordset1);
mysql_select_db($database_incomed, $incomed);
$query_Recordset2 = "SELECT * FROM productos WHERE id =".$row_Recordset1['id_pro'];
$Recordset2 = mysql_query($query_Recordset2, $incomed) or die(mysql_error());
$row_Recordset2 = mysql_fetch_assoc($Recordset2);
$totalRows_Recordset2 = mysql_num_rows($Recordset2);
if ($totalRows_Recordset2!=0){
echo $row_Recordset2['titulo'];}
?>
<html>
<head>
<title>Panel Administrativo</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<style type="text/css">
td img {display: block;}body {
background-image: url();
}
</style>
<!--Fireworks CS3 Dreamweaver CS3 target. Created Thu Jan 31 15:18:44 GMT-0400 2008-->
<link href="../css/estilos.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
a:link {
color: #946C2E;
}
a:visited {
color: #946C2E;
}
a:hover {
color: #ae6800;
}
a:active {
color: #946C2E;
}
.style1 {color: #FFFFFF}
a {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 12px;
}
-->
</style></head>
<body bgcolor="#ffffff">
<table width="500" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="790"><table width="500" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td><img src="../images/panel_head.jpg" alt="" width="500" height="130" /></td>
</tr>
</table></td>
</tr>
<tr>
<td align="left" valign="top"><div align="center"><span class="textopanel">Listado de Productos</span>
<?php if ($totalRows_Recordset1!=0){ ?>
<br>
<br>
</div>
<table width="95%" border="1" align="center" cellpadding="0" cellspacing="2" bordercolor="#000000">
<tr bgcolor="#333333" class="unnamed1">
<td width="109" class="tituloPROD"><div align="center" class="style1">opciones</div></td>
<td width="120" class="tituloPROD"><div align="center" class="style1">Imagen</div></td>
<td width="230" class="tituloPROD style1">Nombre</td>
</tr>
<?php do { ?>
<tr bgcolor="#FFFFFF" class="todopanel">
<td align="center"><a href="act_img.php?id_pro=<?php echo $row_Recordset1['id_pro']; ?>" class="textoINDEX">Modificar</a> / <a href="elimproducto.php?id_pro=<?php echo $row_Recordset1['id_pro']; ?>" class="textoINDEX">Eliminar</a> </a> </td>
<td align="center" class="textopanel"><img src="../images2/<?php echo $row_Recordset1['img']; ?>" width='80' height='53' border='0'></td>
<td class="texto2"><?php echo $row_Recordset2['titulo']; ?></td>
</tr>
<?php } while ($row_Recordset1 = mysql_fetch_assoc($Recordset1)); ?>
</table>
<?php }?>
<br>
<table border="0" width="50%" align="center">
<tr class="Estilo6">
<td width="23%" align="center" class="textoINDEX">
<?php if ($pageNum_Recordset1 > 0) { // Show if not first page ?>
<a href="<?php printf("%s?pageNum_Recordset1=%d%s", $currentPage, 0, $queryString_Recordset1); ?>">Primero</a>
<?php } // Show if not first page ?> </td>
<td width="31%" align="center" class="textoINDEX">
<?php if ($pageNum_Recordset1 > 0) { // Show if not first page ?>
<a href="<?php printf("%s?pageNum_Recordset1=%d%s", $currentPage, max(0, $pageNum_Recordset1 - 1), $queryString_Recordset1); ?>">Anterior</a>
<?php } // Show if not first page ?> </td>
<td width="23%" align="center">
<?php if ($pageNum_Recordset1 < $totalPages_Recordset1) { // Show if not last page ?>
<a href="<?php printf("%s?pageNum_Recordset1=%d%s", $currentPage, min($totalPages_Recordset1, $pageNum_Recordset1 + 1), $queryString_Recordset1); ?>" class="textoINDEX">Siguiente</a>
<?php } // Show if not last page ?> </td>
<td width="23%" align="center" class="textoINDEX">
<?php if ($pageNum_Recordset1 < $totalPages_Recordset1) { // Show if not last page ?>
<a href="<?php printf("%s?pageNum_Recordset1=%d%s", $currentPage, $totalPages_Recordset1, $queryString_Recordset1); ?>">Último</a>
<?php } // Show if not last page ?> </td>
</tr>
</table> </td>
</tr>
<tr>
<td height="30" align="center"><span class="textopie">Incomed, C.A. Todos los derechos reservados 2008.</span></td>
</tr>
</table>
</body>
</html>
<?php
mysql_free_result($Recordset1);
mysql_free_result($Recordset2);
?>
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
Podria alguien ayudarme???....
Gracias :)