Que tal a todos, disculpen mi ignorancia en caso de que este equivocado pero creo que en el código esta el error
Código PHP:
<?
if(!isset($_GET['idNoticia']) || empty($_GET['idNoticia'])){
header("location:listaNoticia.php");
}
else{
include('conec.php');
conectarse();
$query = mysql_query("SELECT * FROM noticias WHERE idNoticia = '".$_GET['idNoticia']."'") or die('MySQL error: '.mysql_error());
while($row = mysql_fetch_array($query)){
echo "<h3>".$row['titulo']."</h3>".$row['mensaje'];
}
}
?>
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td align="center" valign="top"><img src="<?=$row['nomimg']?>"></td>
</tr>
</table>
Para poder ver la imagen la tabla debería estar dentro del WHILE, ya que si te sales del while la variable está vacía (eso a mi parecer), yo creo que metiendo la corrida de la tabla dentro del while quedaría el problema resuelto, te muestro como:
Código PHP:
<?
if(!isset($_GET['idNoticia']) || empty($_GET['idNoticia'])){
header("location:listaNoticia.php");
}
else{
include('conec.php');
conectarse();
$query = mysql_query("SELECT * FROM noticias WHERE idNoticia = '".$_GET['idNoticia']."'") or die('MySQL error: '.mysql_error());
echo '<table border="0" cellpadding="0" cellspacing="0">';
echo '<tr>';
while($row = mysql_fetch_array($query)){
echo "<td><h3>".$row['titulo']."</h3>".$row['mensaje']."</td>";
echo '<td align="center" valign="top"><img src="'.$row['nomimg'].'"></td>';
echo '</tr>';
}
echo '</table>';
}
?>
Disculpen si hay algún error en el código (;, . mal colocado o que faltan lo hice aquí mismo y no se ve muy agradable programar aqui,
![apachar ojo](http://static.forosdelweb.com/fdwtheme/images/smilies/wink.png)
), creo qe así solucionariamos el problema, si no funciona haganlo saber, si estoy perdido en el mundo y no estoy ni cerca del problema haganlo saber pero de buena manera. Espero que te sirva de ayuda. Saludos...