09/09/2003, 12:23
|
|
El error es este:
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/virtual/site236/fst/var/www/html/es/o.php on line 20
Warning: Cannot add header information - headers already sent by (output started at /home/virtual/site236/fst/var/www/html/es/o.php:20) in /home/virtual/site236/fst/var/www/html/es/o.php on line 24
Y el codigo este:
//Conectamos a la base de datos
$link = mysql_connect ($host, $user, $pass);
mysql_select_db($db, $link);
//Enviamos la consulta a la base de datos
$query = "SELECT * FROM tgp ORDER BY RANDOM() LIMIT 1";
$resultado = mysql_db_query ($db, $query, $link);
$row = mysql_fetch_array($resultado);
//Busca resultados en la base de datos
header("Location: $row[url]");
exit;
//cerramos la conexion
mysql_close ($link);
?>
Linea 20:
$row = mysql_fetch_array($resultado);
Ejecutando el error de mysql me sale:
Fallo SELECT * FROM tgp ORDER BY RANDOM() LIMIT 1 .
MySQL dice: You have an error in your SQL syntax near '() LIMIT 1' at line 1
Alguna idea?
Un saludo |