no me muestra las imagenes
Publicado por rstapia (6 intervenciones) el 31/01/2012 13:18:33
He creado una bd en mysql, con los campos Id, producto,precio,imagen (guardo la ruta de la imagen para no engordar la bd)....el problema que tengo es que en el navegador me muestra todos los registros excepto las imágenes que no me muestra nada., os pongo el código generado por dreamweaver :
Este es el código generado por dreamweaver para que veais 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) ..lo que quiero es que me muestre una imagen por cada registro ( su imagen correspondiente)
cómo hacer para que me muestre las imagenes?....gracias
Este es el código generado por dreamweaver para que veais 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) ..lo que quiero es que me muestre una imagen por cada registro ( su imagen correspondiente)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
<?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>Carrito</strong></td>
<td align="center" bgcolor="#993300"> </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);
?>
cómo hacer para que me muestre las imagenes?....gracias
Valora esta pregunta
0