Ver Mensaje Individual
  #15 (permalink)  
Antiguo 10/03/2009, 08:26
ositaprh
 
Fecha de Ingreso: marzo-2009
Mensajes: 12
Antigüedad: 15 años, 1 mes
Puntos: 1
Respuesta: Filtrar una consulta con php a traves de un enlace

Y e echo tantos cambios que no se si como lo he dejado esta bien.
Cita:
<html>
<head>
<title>Games Line</title>
<style type="text/css">
<!--
body,td,th {
color: #FF9933;
}
body {
background-color: #000000;
}
.Estilo1 {color: #CC6600}
.Estilo2 {color: #CC9900; }
-->
</style>
<script language="JavaScript">


</script>
</head>
<body>
<form name="frm_joc" action="default.php" method="GET">
<table width="762" height="68%" border="1" align="center" bordercolor="black" bgcolor="#000000" id="tc">
<tr>
<th width="90" rowspan="3">&nbsp;</th>
<th width="668" height="65" colspan="6"><a href="default.html"><img src="imagenes/cabecera.gif"></a></th>
<th width="80" rowspan="3">&nbsp;</th>
</tr>

<tr bordercolor="white">
<th height="60"><a href="default.php" name="PC" class="Estilo1" id="PC">PC</a> </th>
<th><a href="default.php" name="DS" class="Estilo1" id="DS"> Nintendo DS</a> </th>
<th><a href="default.php" name="WII" class="Estilo1" id="WII" >Nintendo WII</a> </th>
<th><a href="default.php" name="PS2" class="Estilo1" id="PS2" >PlayStation 2 </a></th>
<th><a href="default.php" name="PS3" class="Estilo1" id="PS3" >PlayStation 3 </a> </th>
<th><a href="default.php" name="360" class="Estilo1" id="360" >XBOX 360 </a></th>
</tr>
<tr>
<th height="132" colspan="6">
<?
$connexio = mysql_connect ('localhost','root','');
mysql_select_db ('videojocs',$connexio);

$criterio="";
if (!isset($_GET['plataforma'])) {
$criterio="'PC','DS','WII','PS2','PS3','360'";
}else{
$criterio="'".$_GET['plataforma']."'";
}
$resultado=mysql_query("SELECT id_videojoc, titol, descripcio, imatge, plataforma FROM videojocs WHERE plataforma in (".$criterio.") ORDER BY titol") or die( "Error en query:" . mysql_error() );



$juegos = mysql_fetch_array($resultado);

while ($juegos != FALSE){
$campo=substr($juegos['descripcio'],0,300);
echo '<p>&nbsp;</p>';
echo '<p>&nbsp;</p>';
echo '<table width="600" border="1" cellspacing="3">';
echo '<tr>';
echo '<td width="160"> <img width="158" src="imatges/'.$juegos['imatge'].'"></td>';
echo '<td width="420">'.$campo.'... <a href="detall.php" id="'.$juegos['id_videojoc'].'" class="Estilo1">Leer más.</a></td>';
echo '</tr>';
echo '</table>';
echo '<p>&nbsp;</p>';

$juegos = mysql_fetch_array($resultado);
}

mysql_close ($connexio);

?>
</table>
</form>
</body>
</html>
a ver si e modificado algo q no debia y no me e dado cuenta aunq la verdad ya tengo un buen dolor de cabeza entre q ayer casi no dormi con esto y que ya me estoy mareando de ver tanto codigo.