Problemas con $row=mysql_fetch_row($result)
Publicado por Uri (2 intervenciones) el 10/01/2006 10:15:17
Saludos a todo el mundo!
Estoy empezando a programar con PHP y llevo 2 semanas hundido en la desesperación. He preguntado, lo he puesto de mil maneras pero no funciona. Si alguien me ayudara le estaria MUY agradecido.
LO QUE TENGO:
<?
if ($mostrarNoticies){
$link = mysql_connect("localhost",root);
mysql_select_db("la_traca",$link);
$sql = "SELECT * FROM inici (TITOL, COMENTARIS)";
$sql.= "WHERE ('TITOL=$txtTitolInici', 'COMENTARIS=$comentarisInici')";
$result = mysql_query($sql,$link);
echo "<table border=1 align=center>";
echo "<tr><td><b>TÍTOL DE LA NOTÍCIA</b></td><td><b>COMENTARIS</b></td></tr>";
while($row=mysql_fetch_row($result))
{
echo "<tr><td>$row[0]</td><td>$row[1]</td></tr>";
}
echo "</table>";
}
?>
PROBLEMA:
Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in c:\appserv\www\latraca\gestio\mostrarnoticies.php on line 10
* la linea problematica es esta: while($row=mysql_fetch_row($result))
Que puedo hacer???
Muchas gracias!!!
Estoy empezando a programar con PHP y llevo 2 semanas hundido en la desesperación. He preguntado, lo he puesto de mil maneras pero no funciona. Si alguien me ayudara le estaria MUY agradecido.
LO QUE TENGO:
<?
if ($mostrarNoticies){
$link = mysql_connect("localhost",root);
mysql_select_db("la_traca",$link);
$sql = "SELECT * FROM inici (TITOL, COMENTARIS)";
$sql.= "WHERE ('TITOL=$txtTitolInici', 'COMENTARIS=$comentarisInici')";
$result = mysql_query($sql,$link);
echo "<table border=1 align=center>";
echo "<tr><td><b>TÍTOL DE LA NOTÍCIA</b></td><td><b>COMENTARIS</b></td></tr>";
while($row=mysql_fetch_row($result))
{
echo "<tr><td>$row[0]</td><td>$row[1]</td></tr>";
}
echo "</table>";
}
?>
PROBLEMA:
Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in c:\appserv\www\latraca\gestio\mostrarnoticies.php on line 10
* la linea problematica es esta: while($row=mysql_fetch_row($result))
Que puedo hacer???
Muchas gracias!!!
Valora esta pregunta


0