
09/09/2010, 12:42
|
| | Fecha de Ingreso: septiembre-2010
Mensajes: 13
Antigüedad: 14 años, 7 meses Puntos: 0 | |
Respuesta: ayuda para consulta Cita:
Iniciado por markmb Podrias pasar un valor por GET, por la URL ([URL="http://www.tupagina.com/detalle.php?id=%27id"]www.tupagina.com/detalle.php?id='id[/URL]') Código PHP: <?php
foreach($quejas as $key => $value)
{
print '<tr>';
print '<td>'. $value['fecha'] .'</td>';
print '<td >'. $value['asunto'] .'</td>';
print '<td> '. $value['estado'] .'</td>';
print '<td><a href="detalle.php?id='. $value['id_quejas'].'">ver detalle</a></td>';
//Ves, ahí tienes tu parámetro get
print '<td>'. $value['id_quejas'].'</td>';
print '</tr>';
}
?> Código PHP: <?php
$link = mysql_connect('xxx', 'xxx', 'xxxx');
$db_selected = mysql_select_db('tabla', $link);
if (!$db_selected) {
die ('Can\'t use prueba : ' . mysql_error());
}
$result = "SELECT * FROM `quejas` WHERE id_quejas = ".$_GET['id']." order by fecha desc";
//y ahí lo recoges. Todos los parámetros GET van igual (si no es un número, deberías usarlo así: = '".$_GET['id']."' order...)
$res = mysql_query($result,$link);
$row= mysql_fetch_array($res);
mysql_close($link);
?> muchas gracias amigo..... lo que hice fue con una variable el get y ya funciono...muchas graciuas |