Ver Mensaje Individual
  #11 (permalink)  
Antiguo 16/05/2013, 15:59
Avatar de rulises
rulises
 
Fecha de Ingreso: enero-2008
Mensajes: 54
Antigüedad: 16 años, 3 meses
Puntos: 0
Respuesta: Vinculos relativos a los registros de una tabla

Este es el código completo de la pagina detalles_galeria_probar.php

<?php require_once('Connections/conn_xxxxx.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
if (PHP_VERSION < 6) {
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
}

$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);

switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
}

$currentPage = $_SERVER["PHP_SELF"];

$maxRows_Detalles_galeria = 1;
$pageNum_Detalles_galeria = 0;
if (isset($_GET['pageNum_Detalles_galeria'])) {
$pageNum_Detalles_galeria = $_GET['pageNum_Detalles_galeria'];
}
$startRow_Detalles_galeria = $pageNum_Detalles_galeria * $maxRows_Detalles_galeria;

mysql_select_db($database_conn_xxxxx, $conn_xxxxx);
$query_Detalles_galeria = "SELECT * FROM fotografias ORDER BY Id_Entrada DESC";
$query_limit_Detalles_galeria = sprintf("%s LIMIT %d, %d", $query_Detalles_galeria, $startRow_Detalles_galeria, $maxRows_Detalles_galeria);
$Detalles_galeria = mysql_query($query_limit_Detalles_galeria, $conn_mingorance) or die(mysql_error());
$row_Detalles_galeria = mysql_fetch_assoc($Detalles_galeria);

if (isset($_GET['totalRows_Detalles_galeria'])) {
$totalRows_Detalles_galeria = $_GET['totalRows_Detalles_galeria'];
} else {
$all_Detalles_galeria = mysql_query($query_Detalles_galeria);
$totalRows_Detalles_galeria = mysql_num_rows($all_Detalles_galeria);
}
$colname_Detalles_galeria = "-1";
if (isset($_GET['Id_Entrada'])) {
$colname_Detalles_galeria = $_GET['Id_Entrada'];
}
mysql_select_db($database_conn_xxxxx, $conn_xxxxxx);
$query_Detalles_galeria = sprintf("SELECT * FROM fotografias WHERE Id_Entrada = %s ORDER BY Id_Entrada DESC", GetSQLValueString($colname_Detalles_galeria, "int"));
$Detalles_galeria = mysql_query($query_Detalles_galeria, $conn_xxxxx) or die(mysql_error());
$row_Detalles_galeria = mysql_fetch_assoc($Detalles_galeria);
$totalRows_Detalles_galeria = mysql_num_rows($Detalles_galeria);

$queryString_Detalles_galeria = "";
if (!empty($_SERVER['QUERY_STRING'])) {
$params = explode("&", $_SERVER['QUERY_STRING']);
$newParams = array();
foreach ($params as $param) {
if (stristr($param, "pageNum_Detalles_galeria") == false &&
stristr($param, "totalRows_Detalles_galeria") == false) {
array_push($newParams, $param);
}
}
if (count($newParams) != 0) {
$queryString_Detalles_galeria = "&" . htmlentities(implode("&", $newParams));
}
}
$queryString_Detalles_galeria = sprintf("&totalRows_Detalles_galeria=%d%s", $totalRows_Detalles_galeria, $queryString_Detalles_galeria);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Detalles imágenes premiadas</title>
<link href="xxxxx.css" rel="stylesheet" type="text/css" />
<meta name="Language" content="es" />

</head>

<body class="body">
<table width="100%" border="0" align="center" class="bordes">
<tr>
<td width="10%" height="79" scope="col">&nbsp;</td>
<td width="80%" align="center" valign="top" bgcolor="#F7F7FD" class="sombra" scope="col"><p><img src="Media/Cabecera/texto_oro_flash_transparente_presentacion.png" width="65%" height="100" alt="Francisco_Mingorance_wildlife_photographer" /></p></td>
<td width="10%" scope="col">&nbsp;</td>
</tr>
<tr>
<td width="10%" height="150" align="right" valign="middle" scope="col">&nbsp;</td>
<td width="80%" rowspan="2" align="center" valign="top" bgcolor="#F7F7FD" class="sombra2" scope="col"><table width="100%" align="center" class="bordes">
<tr bgcolor="#DFDFDF">
<th width="20%" height="22" bgcolor="#DFDFDF" scope="col" onmouseover='this.style.background=&quot;#b2d3ee&q uot;' onmouseout='this.style.background=&quot;#DFDFDF&qu ot;'><a href="index.php" class="a">Inicio</a></th>
<th width="20%" height="22" bgcolor="#F7F7FD" scope="col" ><a href="galeria.php" class="link">Galería</a></th>
<th width="20%" height="22" scope="col" onmouseover='this.style.background=&quot;#b2d3ee&q uot;' onmouseout='this.style.background=&quot;#DFDFDF&qu ot;'><a href="francisco_mingorance_el_autor.php" class="a">Autor</a></th>
<th width="20%" height="22" scope="col" onmouseover='this.style.background=&quot;#b2d3ee&q uot;' onmouseout='this.style.background=&quot;#DFDFDF&qu ot;'><a href="contacto_francisco_mingorance.php" class="a">Contacto</a></th>
<th width="20%" height="22" scope="col" onmouseover='this.style.background=&quot;#b2d3ee&q uot;' onmouseout='this.style.background=&quot;#DFDFDF&qu ot;'><a href="login/login.php" class="a">Login</a></th>
</tr>
</table>
<br />
<table width="100%">
<tr>
<th align="center" class="encabezado2" scope="col"></th>
</tr>
<tr>
<td align="center" class="encabezado2"><?php echo $row_Detalles_galeria['Titulo_Fotografia']; ?></td>
</tr>
<tr>
<td height="20" align="center" valign="bottom"><img src="<?php echo $row_Detalles_galeria['Imagen']; ?>" alt="<?php echo $row_Detalles_galeria['ALT_Imagen']; ?>" width="70%" class="sombra_fotos_dinamicas" /></td>
</tr>
<tr>
<td height="53" align="center" valign="top"><?php echo $row_Detalles_galeria['Premios_Fotografia']; ?></td>
</tr>
<tr>
<td height="10" align="center" valign="top">&nbsp;</td>
</tr>
</table></td>
<td width="10%" height="150" align="left" valign="middle" scope="col">&nbsp;</td>
</tr>
<tr>
<td width="10%" height="473" align="right" valign="top" scope="col"><?php
if(mysql_num_rows(mysql_query("select Id_Entrada from fotografias where Id_Entrada=(".($row_Detalles_galeria['Id_Entrada']+1).")"))) echo '<a href="detalles_galeria_probar.php?Id_Entrada='.($r ow_Detalles_galeria['Id_Entrada']+1).'"><img src="Media/Iconos/izquierda_gris.gif" alt="siguiente_galeria" class="iconos" /></a>';
?></td>
<td width="10%" align="left" valign="top" scope="col">
<?php
if(mysql_num_rows(mysql_query("select Id_Entrada from fotografias where Id_Entrada=(".($row_Detalles_galeria['Id_Entrada']-1).")"))) echo '<a href="detalles_galeria_probar.php?Id_Entrada='.($r ow_Detalles_galeria['Id_Entrada']-1).'"><img src="Media/Iconos/derecha_gris.gif" alt="siguiente_galeria" class="iconos" /></a>';
?>
</td>
</tr>
<tr align="left" valign="bottom">
<td height="25" scope="col">&nbsp;</td>
<td height="25" scope="col"><span class="copyright">&copy; Francisco wildlife photographer 2013</span></td>
<td height="25" scope="col">&nbsp;</td>
</tr>
</table>
<br />
</body>
</html>
<?php
mysql_free_result($Detalles_galeria);
?>


Por favor mirame el fallo ocp001a que me has ayudado muchisimo hasta el momento y creo que tú puedes ver mi fallo.
Mil gracias por adelantado