Ver Mensaje Individual
  #7 (permalink)  
Antiguo 13/04/2011, 19:07
Avatar de jbriz_gw
jbriz_gw
 
Fecha de Ingreso: marzo-2009
Ubicación: Perez Zeledon
Mensajes: 39
Antigüedad: 16 años
Puntos: 0
Respuesta: Warning: mysql_fetch_array()

Cita:
Iniciado por gmurop Ver Mensaje
el $idpost te lo devuelve porque no tiene que ver con el error que te está marcando, yo uso mysql_fetch_object, intentalo asi:

Código PHP:
Ver original
  1. <?php
  2. require_once 'conexion.php';
  3.  
  4.  
  5.  
  6. $idpost = $_GET['id_noticia'];
  7. $post = "SELECT * FROM entradas where id_noticia = '$idpost' ";
  8. $res = mysql_query($post);
  9. while($row= mysql_fetch_object($res)) {
  10.  
  11. echo $row->titulo;
  12.  
  13.  
  14. }
  15.  
  16. ?>

Con tu codigo ahora me devuelve este error

Warning: mysql_fetch_object(): supplied argument is not a valid MySQL result resource in C:\xampp\htdocs\curso\news\noticias.php on line 10

y con el $res = mysql_query($post) or die(mysql_error()) ;
me dice No database selected