Ver Mensaje Individual
  #1 (permalink)  
Antiguo 14/06/2012, 08:42
Doch
 
Fecha de Ingreso: mayo-2012
Mensajes: 76
Antigüedad: 11 años, 11 meses
Puntos: 1
error mysql_fetch_assoc

Alguien consigue ver donde cometo el fallo? llevo ya su buena hora
Código PHP:
<?php
$now 
date('Ymd');
$title "TITLULO    ";
$ads mysql_query("SELECT `advert_id` , `image` FROM `adverts` WHERE $now < `expires` AND `shown` =0");

        while (
$ads_row mysql_fetch_assoc($ads)) {
                
$advert_id $ads_row['advert_id'];
                
$image $ads_row['image'];

                        echo 
'<a href="go.php?advert_id='.$advert_id.'" class="show" target="_blank">
                        <img src="'
.$image.'" alt="" width="750" height="150" rel="<center><h3>'.$title.'</h3>"/></center></a>';
 
                        
mysql_query("UPDATE `adverts` SET `shown`=1, `impressions` = `impressions`+1 WHERE `advert_id` = $advert_id");
                
$shown mysql_query("");
        
        if (
mysql_result($shown0) == 0) {
        
mysql_query("UPDATE `adverts` SET `shown`=0");
        }
}
?>
Código HTML:
Warning: mysql_fetch_assoc() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\ads.inc.php on line 6