Ver Mensaje Individual
  #1 (permalink)  
Antiguo 25/06/2012, 23:49
maire
 
Fecha de Ingreso: agosto-2005
Mensajes: 97
Antigüedad: 18 años, 9 meses
Puntos: 1
mensaje de error

tengo este codigo

<div id="middle">
<div id="container">
<div id="content">
<h2>Noticias</h2>
<?php $noti=traer_noticias();

while($noticia=mysql_fetch_assoc($noti) ) {
?>

<div class="noticias">
<h3><?php echo $noticia['titulo']?></h3>
<img src="imagenes/noticias/<?php echo $noticia['imagen']?>" style="float:left" />
<p><?php echo $noticia['texto']?></p>
</div>

<?php } ?>

</div><!-- #content-->
</div><!-- #container-->


en el archivo funciones:


function traer_noticias() {
$query=<<<EOF
SELECT *
FROM noticias
ORDER BY fecha DESC
LIMIT 6
EOF;

$res=mysql_query($query);
return $res;
}

xampp me da el error:


Noticias

Warning: mysql_fetch_assoc() expects parameter 1 to be resource, boolean given in K:\xampp\htdocs\home_zapatos\index.php on line 31

la line 31 es donde esta el while