Ver Mensaje Individual
  #1 (permalink)  
Antiguo 01/01/2003, 18:14
Avatar de sdf23
sdf23
 
Fecha de Ingreso: diciembre-2002
Mensajes: 297
Antigüedad: 21 años, 4 meses
Puntos: 0
ayuda con esto

necesito ayuda con este codigo que es

Código PHP:
<?

$mostrar 
5//Edu aqui pones cuantas noticias mostrara

$host "localhost"
$user ""
$pass ""
$dbname "portalcdr";


$conecta mysql_connect($host,$user,$pass); 
mysql_select_db($dbname,$conecta); 

$query "select * from noticias order by fecha desc";
$resp mysql_query($query);
while (
$datos mysql_fetch_array($resp)) {
     if (
$mostrar 0) {
          
$fecha date("d/m/Y",$datos[fecha]);
          echo 
"
<table width=23% height=88 border=0 align=left>
  <tr>
    <td valign=top bgcolor=#000099><div align=center>
        <p><font color=#FFFF00><strong>$datos[titulo]</strong></font></p>
        <p><font color=#FF0000><strong>$datos[autor] <font color=#FFFFFF>$fecha</font></strong></font></p>
      </div></td>
  </tr>
</table>
<p>&nbsp;</p>
<p>&nbsp;</p>
<table width=80% border=0>
  <tr>
    <td bgcolor=#000099><font color=#FFFFFF>$datos[noticia]</font></td>
  </tr>
</table>
          \n"
;
          
$mostrar--;
     }
}

mysql_query($query); //insertamos el dato
mysql_close($conecta); //cierra la conexion

?>

me sale error dice asi:
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in c:\appserv\www\appserv\cdr\noticias.php on line 16