Hola estoy haciendo un sistema de comentarios, pero me sale un error, el cual no encuentro. Voy a poner el coigo y el error que me da.
el error es :
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in C:\Archivos de programa\Apache Group\Apache2\htdocs\web\ver.php on line 33
y el codigo es el siguiente:
Código:
<?php
/**
*
*
* @version $Id$
* @copyright 2006
*/
$host="localhost";
$root="root";
$pass="";
$con=mysql_connect($host,$root,$pass);
mysql_select_db("noticias",$con);
$id=$_GET[id];
$sql="select * from noticias where id_noticia='$id'";
$rs1=mysql_query($sql,$con);
echo '<table>';
while($row=mysql_fetch_array($rs1)){
echo '<tr><td><h2>'. $row[titulo] . '</h2></td></tr>';
echo '<tr><td>'. $row[Noticia] . '</td></tr>';
echo '<tu div>'.$row[autor].' | '.$row[fecha].' | '.$row[categoria]. '</tu div>';
}
echo '</table>';
$sql2="select * from comentarios where id_noticia='$id'";
$rs2=mysql_query($slq2,$con);
echo '<table>';
while($array=mysql_fetch_array($rs2)){
echo '<tr><td><h2>'. $array[nick] . '</h2></td>';
echo '<td>' . $array[comentario] . '</td></tr>';
}
echo '</table>';
echo '<form action="editacomentario.php" method="post">';
echo '<input type="hidden" name=id value="'. $id .'"><br>';
echo 'Nick:<br>';
echo '<input type="text" name="nick"><br>';
echo 'Escriba el comentario:<br>';
echo '<textarea name="contenido" cols="50" rows="10"></textarea><br>';
echo '<input type="submit" value="Enviar Comentario"><br>';
echo '</form>';
?>