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