Hola Kaninox, bueno mira, tengo el siguiente problema.
La consulta en esta segunda parte es distinta a la primera y contiene un IF y un ELSE, estuve cambándolo y adaptándolo hasta que desaparecieron los errores, pero no me trae ninguna noticia.
Te muestro como es el orginial y como lo dejé para que me tires algunas ideas.
index original (en la segunda parte obviamente):
Código PHP:
<?php
$sql="select id_noticia,titulo,bajada,id_categoria from noticia where fecha='$fecha_' and destacado='no' order by id_categoria";
$que="";
$resultado=mysql_query($sql,$link);
echo mysql_error();
while ($rowa=mysql_fetch_array($resultado))
{
if ($que!=$rowa['id_categoria'])
{
$que=$rowa['id_categoria'];
$sql__="select categoria from categoria where id_categoria='$que' order by categoria";
$resultado__=mysql_query($sql__,$link);
while ($rowa__=mysql_fetch_array($resultado__))
{
?>
<hr align="center" size=0 color="#FFFFFF" width="510" noshade>
<table width="510" align="center">
<tr><td align="center" bgcolor="#D6DEF5" class="listadolinks"><div align="left"></div> <?=$rowa__['categoria']?></td>
</tr></table>
<?php
}
}
else
{
echo "<hr width=510 size=1 noshade>";
}
?>
<table width="510" align="center">
<tr>
<td height="20" align="left" valign="top" class="negro-bd-2">
<?=$rowa['titulo']?>
<br> </td>
<td width="120" rowspan="3" align="center">
<?php
$sql_="select imagen from imagenes where id_noticia='{$rowa['id_noticia']}' limit 1";
$resultado_=mysql_query($sql_,$link);
while ($rowa_=mysql_fetch_array($resultado_))
{
$archivo="imagenes_noticia/";
$archivo.=$rowa_['imagen'];
if (is_file($archivo))
{
?>
<img src="imagenes_noticia/<?=$rowa_['imagen']?>" width="80" border="1">
<? } ?>
<? } ?>
</td>
</tr>
<tr>
<td height="43" align="left" valign="top" class="txt-noticias">
<?=$rowa['bajada']?>
<a href="noticia.php?id=<?=$rowa['id_noticia']?>" onmouseover="status='Ampliar noticia'; return true" onmouseout="status=''" class="listadolinks Estilo1">> Ampliar</a></td>
</tr>
</table>
<?
}
?>
Bueno, ahora posteo lo que estuve retocando:
Código PHP:
<?php
$que="";
$noti_hoy2 = mysql_query(" SELECT id_noticia,titulo,bajada,id_categoria FROM noticia"
." WHERE home = 'si' "
." AND destacado = 'no' "
." ORDER BY id_noticia DESC limit 15");
while ($resulta = mysql_fetch_array($noti_hoy2))
{
?>
<?php
if ($que!=$resulta['id_categoria'])
{
$que=$resulta['id_categoria'];
$sql__= mysql_query(" SELECT categoria FROM noticia"
." WHERE id_categoria = '$que' "
." ORDER BY categoria");
while ($resulta__=mysql_fetch_array($sql__))
{
?>
<hr align="center" size=0 color="#FFFFFF" width="510" noshade>
<table width="510" align="center">
<tr><td align="center" bgcolor="#D6DEF5" class="listadolinks"><div align="left"></div> <?=$resulta__['categoria']?></td>
</tr></table>
<table width="510" align="center">
<tr>
<td class="negro-bd-2">
<?=$resulta['titulo']?>
<br> </td>
<td width="120" rowspan="3" align="center">
<?
$sql_=(" SELECT * FROM imagenes WHERE id_noticia= '{$resulta['id_noticia']}' limit 1");
$resultado_=mysql_query($sql_);
while ($resulta_= mysql_fetch_array($sql_))
{
$archivo="imagenes_noticia/";
$archivo.=$resulta_['imagen'];
if (is_file($archivo))
{
?>
<img src="imagenes_noticia/<?=$resulta_['imagen']?>" width="80" border="1">
<? } ?>
<? } ?>
</td>
</tr>
<tr>
<td height="43" align="left" valign="top" class="txt-noticias">
<?=$resulta['bajada']?>
<a href="noticia.php?id=<?=$resulta['id_noticia']?>" class="listadolinks Estilo1">> Ampliar</a></td>
</tr>
</table>
<hr align="center" size=0 color="#FFFFFF" width="510" noshade>
<p> </p>
<table width="510" border="0" align="center">
<tr>
<td bgcolor="#FF9900" class="listadolinks"><div align="center"> El Acontecer Diario - Durazno, Uruguay - Artigas 374- Telefax: +598 362 4416- Realización Diez </div></td>
</tr>
</table>
<td valign="top" bgcolor="#E9E9E9"><img src="ultimo.jpg" width="115" height="20"> <p align="center"> <img src="cotizatiempo.jpg" width="108" height="200"></td>
</tr>
</table>
</table>
</body>
</html>
Ahora no puedo sacar el error, me dice que hay un cierre inesperado del html, voy a ver si lo puedo arreglar.. sino no sé si da errores.