Foros del Web » Programando para Internet » PHP »

error: Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result re

Estas en el tema de error: Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result re en el foro de PHP en Foros del Web. Hola tengo un codigo que lo que hace es mostrar una noticia recogida de la pagina que muestra todas las noticias, la pagina que me ...

  #1 (permalink)  
Antiguo 29/04/2009, 12:56
Avatar de rompeguesos  
Fecha de Ingreso: marzo-2009
Mensajes: 692
Antigüedad: 15 años, 1 mes
Puntos: 8
Pregunta error: Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result re

Hola tengo un codigo que lo que hace es mostrar una noticia recogida de la pagina que muestra todas las noticias, la pagina que me da ese error es mas.php y el codigo es el siguiente:

Código PHP:
<?php  

include("../reg/config.php"); 

if(isset(
$_GET['not_ID'])){      
    
$not_ID $_GET['not_ID'];  
    
$sqlQueryNot mysql_query("SELECT * FROM noticias WHERE not_ID='$not_ID'"$db_link) or die(mysql_error); 

$rowNot mysql_fetch_array($sqlQueryNot);{ 
    echo 
"<h2>".$rowNot['titulo']."</h2>";  
    echo 
$rowNot['texto']; 
    }  

?>
la pagina desde la que se llega al mas.php es vertodas.php y es el siguiente codigo:

Código PHP:
<?php
session_start
();

include(
"../reg/config.php");

// armamos la consulta
$sqlQueryNot mysql_query("SELECT not_ID, titulo, texto, email, f_alta, imagen FROM noticias"$db_link)
or die(
mysql_error());
// mostramos las noticias,
// otra vez usando un bucle while
while($rowNot mysql_fetch_array($sqlQueryNot)){
echo 
"<h1>$rowNot[titulo]</h1>";
echo 
"Noticia enviada por: ".$rowNot['email']." Fecha: ".$rowNot['f_alta']."<br/><br/>";
echo 
nl2br($rowNot['texto'])."<br/><br/>";
echo 
"<img src=\"imagenes/".$rowNot['imagen']."\" width=\"100\" height=\"100\" alt=\"Descripcion\" />";
echo 
"<a href=\"mas.php?not_id=".$rowNot['not_ID']."\" target=\"_blank\">Más</a>";
}
?>
que hago mal?

El error es este:

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /mnt/web7/32/27/51920027/htdocs/coriaweb/usuarios/noticias/mas.php on line 9

Última edición por rompeguesos; 29/04/2009 a las 12:58 Razón: Se me olvido indicar el error :D
  #2 (permalink)  
Antiguo 29/04/2009, 13:07
Avatar de carmagedon  
Fecha de Ingreso: junio-2005
Ubicación: Argentina
Mensajes: 794
Antigüedad: 18 años, 10 meses
Puntos: 23
Respuesta: error: Warning: mysql_fetch_array(): supplied argument is not a valid MySQ

Código PHP:
<?php  

include("../reg/config.php"); 

if(isset(
$_GET['not_ID'])){      
    
$not_ID $_GET['not_ID'];  
    
$sqlQueryNot mysql_query("SELECT * FROM noticias WHERE not_ID='".$_GET["not_ID"]."'"$db_link) or die(mysql_error()); 

$rowNot mysql_fetch_array($sqlQueryNot); //no lleva la llave porque no hay ningun WHILE
    
echo "<h2>".$rowNot['titulo']."</h2>";  
    echo 
$rowNot['texto']; 
    
//te saque la llave

?>
Fijate si está ahi el problema, cualquier cosa volveme a decir que lo revisamos mas detalladamente.

Saludos
__________________
Freelance - Aplicaciones Web
  #3 (permalink)  
Antiguo 29/04/2009, 13:14
Avatar de rompeguesos  
Fecha de Ingreso: marzo-2009
Mensajes: 692
Antigüedad: 15 años, 1 mes
Puntos: 8
Respuesta: error: Warning: mysql_fetch_array(): supplied argument is not a valid MySQ

sigue dando este error:

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /mnt/web7/32/27/51920027/htdocs/coriaweb/usuarios/noticias/mas.php on line 9
  #4 (permalink)  
Antiguo 29/04/2009, 13:39
Avatar de buzu  
Fecha de Ingreso: octubre-2006
Ubicación: San Francisco, CA
Mensajes: 2.168
Antigüedad: 17 años, 6 meses
Puntos: 122
Respuesta: error: Warning: mysql_fetch_array(): supplied argument is not a valid MySQ

Imagino que tu id es un integrer, por lo que probablemente las comillas son las que te están dando el problema:

Código php:
Ver original
  1. $sqlQueryNot = mysql_query("SELECT * FROM noticias WHERE not_ID='$not_ID'", $db_link) or die(mysql_error);

Prueva con:
Código php:
Ver original
  1. $sqlQueryNot = mysql_query("SELECT * FROM noticias WHERE not_ID=$not_ID", $db_link) or die(mysql_error);

También elimina esas llaves de las que carmagedon te habló.
__________________
twitter: @imbuzu
  #5 (permalink)  
Antiguo 29/04/2009, 13:43
Avatar de rompeguesos  
Fecha de Ingreso: marzo-2009
Mensajes: 692
Antigüedad: 15 años, 1 mes
Puntos: 8
Respuesta: error: Warning: mysql_fetch_array(): supplied argument is not a valid MySQ

si es integer y tambien he quitado las llaves pero sigue saliendo el error eso como es? :D. El codigo ahora mismo esta asi:

Código PHP:
<?php  

include("../reg/config.php"); 

if(isset(
$_GET['not_ID'])){      
    
$not_ID $_GET['not_ID'];  
    
$sqlQueryNot mysql_query("SELECT * FROM noticias WHERE not_ID=$not_ID"$db_link) or die(mysql_error); 

$rowNot mysql_fetch_array($sqlQueryNot); //no lleva la llave porque no hay ningun WHILE
    
echo "<h2>".$rowNot['titulo']."</h2>";  
    echo 
$rowNot['texto']; 
    
//te saque la llave

?>
  #6 (permalink)  
Antiguo 29/04/2009, 14:40
Avatar de buzu  
Fecha de Ingreso: octubre-2006
Ubicación: San Francisco, CA
Mensajes: 2.168
Antigüedad: 17 años, 6 meses
Puntos: 122
Respuesta: error: Warning: mysql_fetch_array(): supplied argument is not a valid MySQ

Lo más probable es que la variable $_GET['not_ID'] no exista y por lo tanto no se haga la petición por lo que le pasas un valor no valido a tu mysql_fetch...

Por que no has puesto todo dentro del if()? Haz un
echo $_GET['not_ID'];
Para comprobar que la variable existe.
__________________
twitter: @imbuzu
  #7 (permalink)  
Antiguo 29/04/2009, 14:58
Avatar de carmagedon  
Fecha de Ingreso: junio-2005
Ubicación: Argentina
Mensajes: 794
Antigüedad: 18 años, 10 meses
Puntos: 23
Respuesta: error: Warning: mysql_fetch_array(): supplied argument is not a valid MySQ

Lo que pasa es que probablemente al dejar $not_id no te funciona en php 5, eso te funcionaria bien en la version anterior.

Utiliza lo que es GET o POST para cargar las variables. Y si, prueba con hacer un echo para comprobar de que llegue la variable.

Si llega bien, y te sigue tirando ese mismo error, chekea el archivo conexion a tu base de datos, quizas tenga problemas en el identificador de la conexion.

Y otra cosa, mysql_error, no lleva los paréntesis? " () ". Yo te lo puse en el codigo cuando te lo modifique, pero no me hiciste caso.

Saludos.
__________________
Freelance - Aplicaciones Web
  #8 (permalink)  
Antiguo 29/04/2009, 16:12
Avatar de buzu  
Fecha de Ingreso: octubre-2006
Ubicación: San Francisco, CA
Mensajes: 2.168
Antigüedad: 17 años, 6 meses
Puntos: 122
Respuesta: error: Warning: mysql_fetch_array(): supplied argument is not a valid MySQ

es cierto, ese mysql_error tiene que llevar paréntesis. Ponlos y dinos que error te tira.
__________________
twitter: @imbuzu
  #9 (permalink)  
Antiguo 29/04/2009, 17:02
Avatar de rompeguesos  
Fecha de Ingreso: marzo-2009
Mensajes: 692
Antigüedad: 15 años, 1 mes
Puntos: 8
Respuesta: error: Warning: mysql_fetch_array(): supplied argument is not a valid MySQ

No hay modo de hacerle un echo a eso, mira si lo meto todo dentro del if sale la pagina en blanco lo que veo que el id si que lo recoge porque la pagina a la que se redirige sale asi:

http://www.coriaweb.es/coriaweb/usua....php?not_id=24 <-- el numero del id lo pasa.

ponga el echo donde lo ponga sale la pagina en blanco teniendolo todo dentro del if.

Que cosa mas rara no?

El codigo esta ahora mismo asi mas.php:

Código PHP:
<?php  

include("../reg/config.php"); 

if(isset(
$_GET['not_ID'])){      
    
$not_ID $_GET['not_ID'];  
    
$sqlQueryNot mysql_query("SELECT * FROM noticias WHERE not_ID=$not_ID"$db_link) or die(mysql_error()); 
 
$rowNot mysql_fetch_array($sqlQueryNot); //no lleva la llave porque no hay ningun WHILE
    
echo "<h2>".$rowNot['titulo']."</h2>";  
    echo 
$rowNot['texto']; 
    
//te saque la llave
    
}
    echo 
$_GET['not_ID'];
?>
  #10 (permalink)  
Antiguo 29/04/2009, 17:10
 
Fecha de Ingreso: junio-2008
Mensajes: 93
Antigüedad: 15 años, 10 meses
Puntos: 1
Respuesta: error: Warning: mysql_fetch_array(): supplied argument is not a valid MySQ

Prueba con esta modificacion, es posible que lo que recoges no tenga valor o no exista, de ahi que en el codigo te ponga un echo a esa variable, para que veas que si tiene el valor que deseas. Sino...pues...puede ser la conexion...

Código:
<?php  

include("../reg/config.php"); 

if(isset($_GET['not_ID'])){      
    echo $_GET['not_ID']; 
    if(!isset($_GET['not_ID'])) $not_ID = $_GET['not_ID']; 
    else $not_ID = 1 //Por ejemplo 
    $sqlQueryNot = mysql_query("SELECT * FROM noticias WHERE not_ID=$not_ID", $db_link) or die(mysql_error()); 
 
$rowNot = mysql_fetch_array($sqlQueryNot); //no lleva la llave porque no hay ningun WHILE
    echo "<h2>".$rowNot['titulo']."</h2>";  
    echo $rowNot['texto']; 
    //te saque la llave
    }
    echo $_GET['not_ID'];
?>
  #11 (permalink)  
Antiguo 29/04/2009, 17:16
Avatar de rompeguesos  
Fecha de Ingreso: marzo-2009
Mensajes: 692
Antigüedad: 15 años, 1 mes
Puntos: 8
Respuesta: error: Warning: mysql_fetch_array(): supplied argument is not a valid MySQ

Me va a volver loco esto en , poniendo ese codigo vuelve a salir un error esta vez es este:

Parse error: syntax error, unexpected T_VARIABLE in /mnt/web7/32/27/51920027/htdocs/coriaweb/usuarios/noticias/mas.php on line 9

Mira la pagina de la que viene es esta que muestra las noticias de la base de datos que es el odigo que puse anteriormente por hay atras de vertodas.php es esta:

http://www.coriaweb.es/coriaweb/usua...s/vertodas.php

hay se muestran unas noticias junto a un mas que es al que cuando pincha se redirige al mas.php.

¿Va a costar hacer esto funcionar en? jejej haber que solucion le puedo dar?
  #12 (permalink)  
Antiguo 29/04/2009, 17:37
Avatar de rompeguesos  
Fecha de Ingreso: marzo-2009
Mensajes: 692
Antigüedad: 15 años, 1 mes
Puntos: 8
Pregunta Respuesta: error: Warning: mysql_fetch_array(): supplied argument is not a valid MySQ

Cita:
Iniciado por Vitolo_1 Ver Mensaje

Código:
<?php  
    else $not_ID = 1 //Por ejemplo 
?>
Creo que el problema era que aqui le faltaba un ";" se lo e puesto pero vuelve a salir la pagina en blanco me via dar chocazos ya en jejej.

Alguna idea mas?
  #13 (permalink)  
Antiguo 29/04/2009, 18:27
Avatar de carmagedon  
Fecha de Ingreso: junio-2005
Ubicación: Argentina
Mensajes: 794
Antigüedad: 18 años, 10 meses
Puntos: 23
Respuesta: error: Warning: mysql_fetch_array(): supplied argument is not a valid MySQ

Ah te querés matar entonces jaja.

Código PHP:
<?php  
include("../reg/config.php"); 

if(isset(
$_GET['not_ID'])){      
    echo 
$_GET['not_ID']; 
}

if(!isset(
$_GET['not_ID'])) {
    
$not_ID $_GET['not_ID']; 
}else{
    
$not_ID 1//Por ejemplo 
}

    
$estructura "SELECT * FROM noticias WHERE not_ID = "$not_ID ."";
        
$sqlQueryNot mysql_query($estructura$db_link) or die(mysql_error()); 
 
        
$rowNot mysql_fetch_array($sqlQueryNot); 
        echo 
"<h2>".$rowNot['titulo']."</h2>";  
        echo 
$rowNot['texto']; 
        echo 
$_GET['not_ID'];
?>
Fijate si te anda así, sino yo hasta acá llegue jaja, porque no sé donde puede existir la falla.

Un saludo.
__________________
Freelance - Aplicaciones Web
  #14 (permalink)  
Antiguo 29/04/2009, 18:31
Avatar de rompeguesos  
Fecha de Ingreso: marzo-2009
Mensajes: 692
Antigüedad: 15 años, 1 mes
Puntos: 8
Respuesta: error: Warning: mysql_fetch_array(): supplied argument is not a valid MySQ

jejej lo que sale ahora es esto:

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1

eso que quiere decir?
  #15 (permalink)  
Antiguo 29/04/2009, 18:32
Avatar de carmagedon  
Fecha de Ingreso: junio-2005
Ubicación: Argentina
Mensajes: 794
Antigüedad: 18 años, 10 meses
Puntos: 23
Respuesta: error: Warning: mysql_fetch_array(): supplied argument is not a valid MySQ

Código PHP:
$estructura "SELECT * FROM noticias WHERE not_ID = $not_ID "
Cambia ésto entonces... a ver... ¬¬
__________________
Freelance - Aplicaciones Web
  #16 (permalink)  
Antiguo 29/04/2009, 18:34
Avatar de rompeguesos  
Fecha de Ingreso: marzo-2009
Mensajes: 692
Antigüedad: 15 años, 1 mes
Puntos: 8
Respuesta: error: Warning: mysql_fetch_array(): supplied argument is not a valid MySQ

jejejeje me rio por no liarme ya a llorar :D, sigue saliendo eso:

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
  #17 (permalink)  
Antiguo 29/04/2009, 18:48
Avatar de carmagedon  
Fecha de Ingreso: junio-2005
Ubicación: Argentina
Mensajes: 794
Antigüedad: 18 años, 10 meses
Puntos: 23
Respuesta: error: Warning: mysql_fetch_array(): supplied argument is not a valid MySQ

Si, la verdad que me está por agarrar un ataque de locura jaja xD
Fijate, lee todo lo que te dijimos, y andá probando en modificar el mysql_query que por lo visto está ahi la falla, yo ahora ya me tengo que ir, pero proba en sacar la var $estructura y volve a poner el contenido ahi adentro, pero eso no cambia en nada, todo lo contrario...
Fijate bien la variable del segundo campo del mysql_query que es la de la conexion a la base de datos, fijate que esté bien realizada y no tenga ningun problema.

Si nadie te resuelve el problema, mañana me conecto de nuevo y lo vemos mas tranqui.
Saludos.
__________________
Freelance - Aplicaciones Web
  #18 (permalink)  
Antiguo 29/04/2009, 18:52
Avatar de acoevil  
Fecha de Ingreso: julio-2008
Ubicación: localhost/colombia/sevillaValle.php
Mensajes: 1.123
Antigüedad: 15 años, 8 meses
Puntos: 32
Respuesta: error: Warning: mysql_fetch_array(): supplied argument is not a valid MySQ

$estructura = "SELECT * FROM noticias WHERE not_ID = '$not_ID' "; Faltan las comillas simples
  #19 (permalink)  
Antiguo 29/04/2009, 18:54
Avatar de rompeguesos  
Fecha de Ingreso: marzo-2009
Mensajes: 692
Antigüedad: 15 años, 1 mes
Puntos: 8
Pregunta Respuesta: error: Warning: mysql_fetch_array(): supplied argument is not a valid MySQ

Vale perfecto pero ahora voy a probar de otro modo, mira son solo dos paginas no vamos a ser capaces de sacar el fallo? jejej. Mira solo hay dos paginas una es vertodas.php y otra mas.php. El codigo de vertodas.php es el siguiente:

Código PHP:
<?php
session_start
();

include(
"../reg/config.php");

// armamos la consulta
$sqlQueryNot mysql_query("SELECT not_ID, titulo, texto, email, f_alta, imagen FROM noticias"$db_link)
or die(
mysql_error());
// mostramos las noticias,
// otra vez usando un bucle while
while($rowNot mysql_fetch_array($sqlQueryNot)){
echo 
"<h1>$rowNot[titulo]</h1>";
echo 
"Noticia enviada por: ".$rowNot['email']." Fecha: ".$rowNot['f_alta']."<br/><br/>";
echo 
nl2br($rowNot['texto'])."<br/><br/>";
echo 
"<img src=\"imagenes/".$rowNot['imagen']."\" width=\"100\" height=\"100\" alt=\"Descripcion\" />";
echo 
"<a href=\"mas.php?not_id=".$rowNot['not_ID']."\" target=\"_blank\">Más...</a>";
}
?>
Aqui lo que recoge el id de la noticia es $rowNot['not_ID'] esto tiene algo que ver?. Digo esto para que empecemos a investigar desde el principio desde la pagina que muestra las noticias haber si aqui hay algun fallo que yo no me haya dado cuenta...... ¿Como lo ves?
  #20 (permalink)  
Antiguo 29/04/2009, 19:03
Avatar de acoevil  
Fecha de Ingreso: julio-2008
Ubicación: localhost/colombia/sevillaValle.php
Mensajes: 1.123
Antigüedad: 15 años, 8 meses
Puntos: 32
Respuesta: error: Warning: mysql_fetch_array(): supplied argument is not a valid MySQ

Cita:
Iniciado por rompeguesos Ver Mensaje

Aqui lo que recoge el id de la noticia es $rowNot['not_ID'] esto tiene algo que ver?. Digo esto para que empecemos a investigar desde el principio desde la pagina que muestra las noticias haber si aqui hay algun fallo que yo no me haya dado cuenta...... ¿Como lo ves?
No entiendo lo que dices

No veo errores en tu codigo me podrias indicar el error que te sale??
  #21 (permalink)  
Antiguo 29/04/2009, 19:08
Avatar de rompeguesos  
Fecha de Ingreso: marzo-2009
Mensajes: 692
Antigüedad: 15 años, 1 mes
Puntos: 8
Respuesta: error: Warning: mysql_fetch_array(): supplied argument is not a valid MySQ

no no aqui no me sale nada es en la pagina mas.php que no se muestra la noticia. Mira al pinchar en el enlace "Mas" no muestra nada se queda una pagina en blanco pero en el navegador sale con la id de la noticia, queda una cosa asi...:

http://www.coriaweb.es/coriaweb/usua....php?not_id=23 <--- lo que es el id de la noticia lo pasa.

Pero no se porque no se muestra nada en mas.php queda una pagina completamente en blanco.... Entiendes ahora?
  #22 (permalink)  
Antiguo 29/04/2009, 19:13
Avatar de acoevil  
Fecha de Ingreso: julio-2008
Ubicación: localhost/colombia/sevillaValle.php
Mensajes: 1.123
Antigüedad: 15 años, 8 meses
Puntos: 32
Respuesta: error: Warning: mysql_fetch_array(): supplied argument is not a valid MySQ

Y supongo que en la otra pagina estas recojiendo el valor de not_id utlizando el metodo $_GET..

es decir

$not_id=$_GET['not_id'];
  #23 (permalink)  
Antiguo 29/04/2009, 19:15
Avatar de rompeguesos  
Fecha de Ingreso: marzo-2009
Mensajes: 692
Antigüedad: 15 años, 1 mes
Puntos: 8
Respuesta: error: Warning: mysql_fetch_array(): supplied argument is not a valid MySQ

y este es el codigo del mas.php:

Código PHP:
<?php  
include("../reg/config.php");

if(isset(
$_GET['not_ID'])){      
    echo 
$_GET['not_ID']; 
}

if(!isset(
$_GET['not_ID'])) {
    
$not_ID $_GET['not_ID']; 
}else{
    
$not_ID 1//Por ejemplo 
}

    
$estructura "SELECT * FROM noticias WHERE not_ID = '$not_ID' ";
        
$sqlQueryNot mysql_query($estructura$db_link) or die(mysql_error()); 
 
        
$rowNot mysql_fetch_array($sqlQueryNot); 
        echo 
"<h2>".$rowNot['titulo']."</h2>";  
        echo 
$rowNot['texto']; 
        echo 
$_GET['not_ID'];
?>
no hay mas codigo..... que le pasara?
  #24 (permalink)  
Antiguo 29/04/2009, 19:21
Avatar de acoevil  
Fecha de Ingreso: julio-2008
Ubicación: localhost/colombia/sevillaValle.php
Mensajes: 1.123
Antigüedad: 15 años, 8 meses
Puntos: 32
Respuesta: error: Warning: mysql_fetch_array(): supplied argument is not a valid MySQ

A ver intenta con este


include("../reg/config.php");

$not_ID=$_GET['not_ID'];


$estructura = "SELECT * FROM noticias WHERE not_ID = '$not_ID' ";
$sqlQueryNot = mysql_query($estructura, $db_link) or die(mysql_error());

$rowNot = mysql_fetch_array($sqlQueryNot);
echo "<h2>".$rowNot['titulo']."</h2>";
echo $rowNot['texto'];
echo $_GET['not_ID'];
?>
  #25 (permalink)  
Antiguo 29/04/2009, 19:25
Avatar de rompeguesos  
Fecha de Ingreso: marzo-2009
Mensajes: 692
Antigüedad: 15 años, 1 mes
Puntos: 8
Respuesta: error: Warning: mysql_fetch_array(): supplied argument is not a valid MySQ

no......... , no hay manera... Sigue saliendo la pagina en blanco. mira puedes probarlo aqui:

http://www.coriaweb.es/coriaweb/usua...s/vertodas.php

pincha en un "Mas" (No te preocupes por el diseño :P es solo pruebas miestras se monta)
  #26 (permalink)  
Antiguo 29/04/2009, 19:29
Avatar de acoevil  
Fecha de Ingreso: julio-2008
Ubicación: localhost/colombia/sevillaValle.php
Mensajes: 1.123
Antigüedad: 15 años, 8 meses
Puntos: 32
Respuesta: error: Warning: mysql_fetch_array(): supplied argument is not a valid MySQ

Y estas seguro que si tienes un registro en tu DB con el ID que trae $not_ID por ejemplo la primer notica trae esto not_id=24 haz una consulta a tu DB para comprobar si efectivamente tienes un registro asi
  #27 (permalink)  
Antiguo 29/04/2009, 19:34
Avatar de rompeguesos  
Fecha de Ingreso: marzo-2009
Mensajes: 692
Antigüedad: 15 años, 1 mes
Puntos: 8
Respuesta: error: Warning: mysql_fetch_array(): supplied argument is not a valid MySQ

si los hay mira este es el sql que e exportado:

Estructura de tabla para la tabla `noticias`
--

CREATE TABLE `noticias` (
`not_ID` int(11) NOT NULL auto_increment,
`titulo` varchar(50) character set utf8 collate utf8_spanish_ci NOT NULL,
`texto` text character set utf8 collate utf8_spanish_ci NOT NULL,
`email` varchar(40) character set utf8 collate utf8_spanish_ci NOT NULL,
`f_alta` date NOT NULL,
`imagen` varchar(50) character set utf8 collate utf8_spanish_ci NOT NULL,
PRIMARY KEY (`not_ID`)
) ENGINE=MyISAM AUTO_INCREMENT=25 DEFAULT CHARSET=latin1 COLLATE=latin1_german1_ci AUTO_INCREMENT=25 ;

--
-- Volcar la base de datos para la tabla `noticias`
--

INSERT INTO `noticias` VALUES (24, 'xcaxzaxxxs', 'sadsdsdsdsad', '[email protected]', '2009-04-29', 'logo.jpg');
INSERT INTO `noticias` VALUES (23, 'xcaxzaxxxs', 'sadsdsdsdsad', '[email protected]', '2009-04-29', 'logo.jpg');
INSERT INTO `noticias` VALUES (22, 'probandooooo', 'textooo 11111111111', '[email protected]', '2009-04-29', 'logo.jpg');

Lo que si no existiera ese registro no se mostraria la noticia en la pagina vertodas.php no? o eso no tiene nada que ver?
  #28 (permalink)  
Antiguo 29/04/2009, 19:39
Avatar de acoevil  
Fecha de Ingreso: julio-2008
Ubicación: localhost/colombia/sevillaValle.php
Mensajes: 1.123
Antigüedad: 15 años, 8 meses
Puntos: 32
Respuesta: error: Warning: mysql_fetch_array(): supplied argument is not a valid MySQ

Ja si tienes demaciada razon jeje sorry a ver intentemos desesperadamente por este lado xD
si miras la URL generada es

http://www.coriaweb.es/coriaweb/usua...icias/mas.php?not_id=22

el not_id es minuscula q tal si cojemos ese valor en el get con minusculas

include("../reg/config.php");

$not_ID=$_GET['not_id'];


$estructura = "SELECT * FROM noticias WHERE not_ID = '$not_ID' ";
$sqlQueryNot = mysql_query($estructura, $db_link) or die(mysql_error());

$rowNot = mysql_fetch_array($sqlQueryNot);
echo "<h2>".$rowNot['titulo']."</h2>";
echo $rowNot['texto'];
echo $_GET['not_ID'];
?>
  #29 (permalink)  
Antiguo 29/04/2009, 19:44
Avatar de rompeguesos  
Fecha de Ingreso: marzo-2009
Mensajes: 692
Antigüedad: 15 años, 1 mes
Puntos: 8
Respuesta: error: Warning: mysql_fetch_array(): supplied argument is not a valid MySQ

que alguien me haga un gran favoooooor ¡Que me de dos o tres guantazos bien dados! jajaja ahora si se muesta perfectamente y toda la tarde por una simple minuscula la cual ni me habia dado cuenta? esto es pa jartarse de llora y lo demas es tonteria :D.

Acoevil te digo como le dije una vez a otro compañero que me ayudo un monton, pideme lo que quieras menos mi novia, dinero, casa, coche, etc.... etc..... jejejeje Te voy a subir er karma un poquito y te agradezco 100% tu gran ayuda .
  #30 (permalink)  
Antiguo 29/04/2009, 19:45
Avatar de acoevil  
Fecha de Ingreso: julio-2008
Ubicación: localhost/colombia/sevillaValle.php
Mensajes: 1.123
Antigüedad: 15 años, 8 meses
Puntos: 32
Respuesta: error: Warning: mysql_fetch_array(): supplied argument is not a valid MySQ

jajaja bueno no hya problema te cuidas
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 00:43.