Ver Mensaje Individual
  #11 (permalink)  
Antiguo 30/01/2012, 11:55
rstapia
 
Fecha de Ingreso: enero-2004
Mensajes: 33
Antigüedad: 21 años, 2 meses
Puntos: 0
Respuesta: no me salenlas imagenes...donde está el error

pues no lo entiendo...según me dices tengo que declarar antes la variable, sin embargo, para los demas campos, no hace falta, es decir, yo no he declarado en ningun sitio la variable Id, ni producto ni precio, sin embargo si que me los lista correctamente la tabla....mira te paso el código generado por dreamweaver para que veas que es lo que ha hecho.: lo que hace es que me lista todos los registros de la bd y el registro correspondiente a la imagen (en el que yo guardo la ruta de la image para no engordar la bd) pues me muestra la ruta que yo le he puesto, y si lo cambio por el código del Id que puse anteriormente pues me lista la imagen pero siempre la misma.....lo que quiero es que me muestre una imagen por cada registro ( su imagen correspondiente)

<?php require_once('Connections/conexion.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;
}
}

$maxRows_rsconsulta = 10;
$pageNum_rsconsulta = 0;
if (isset($_GET['pageNum_rsconsulta'])) {
$pageNum_rsconsulta = $_GET['pageNum_rsconsulta'];
}
$startRow_rsconsulta = $pageNum_rsconsulta * $maxRows_rsconsulta;

mysql_select_db($database_carrito, $carrito);
$query_rsconsulta = "SELECT * FROM productos";
$query_limit_rsconsulta = sprintf("%s LIMIT %d, %d", $query_rsconsulta, $startRow_rsconsulta, $maxRows_rsconsulta);
$rsconsulta = mysql_query($query_limit_rsconsulta, $carrito) or die(mysql_error());
$row_rsconsulta = mysql_fetch_assoc($rsconsulta);

if (isset($_GET['totalRows_rsconsulta'])) {
$totalRows_rsconsulta = $_GET['totalRows_rsconsulta'];
} else {
$all_rsconsulta = mysql_query($query_rsconsulta);
$totalRows_rsconsulta = mysql_num_rows($all_rsconsulta);
}
$totalPages_rsconsulta = ceil($totalRows_rsconsulta/$maxRows_rsconsulta)-1;
?>
<!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>Documento sin título</title>
</head>

<body>
<table border="1" align="center" cellpadding="5" cellspacing="5">
<tr>
<td colspan="4" align="left" bgcolor="#990000"><strong>Tutorial carrito de la compra</strong></td>
<td align="center" bgcolor="#993300">&nbsp;</td>
<td colspan="4" align="center" bgcolor="#993300"><form id="form1" name="form1" method="post" action="">
<label for="textfield"><strong>Buscar</strong></label>
<input type="text" name="textfield" id="textfield" />
<input type="submit" name="enviar" id="enviar" value="Enviar" />
</form></td>
</tr>
<tr>
<td align="center" bgcolor="#990000">Id</td>
<td align="center" bgcolor="#993300">Producto</td>
<td align="center" bgcolor="#993300">Precio</td>
<td align="center" bgcolor="#993300">Imagen</td>
<td bgcolor="#993300">Agregarlo</td>
</tr>
<?php do { ?>
<tr>
<td><?php echo $row_rsconsulta['Id']; ?></td>
<td><?php echo $row_rsconsulta['Producto']; ?></td>
<td><?php echo $row_rsconsulta['Precio']; ?></td>
<td><?php echo $row_rsconsulta['Imagen']; ?></td>

<td><a href="principal.php">Agregarlo</a></td>
</tr>
<?php } while ($row_rsconsulta = mysql_fetch_assoc($rsconsulta)); ?>
</table>
</body>
</html>
<?php
mysql_free_result($rsconsulta);
?>