Okay, I’ve been making a PHP commenting script, and it seems as though the last thing I need it to echo the database. For some reason, it is giving me this error:
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 ‘Resource id #6’ at line 1.
My code…
<?php
//conection
mysql_connect("localhost","root","") or die(mysql_error());
echo "Connected!";
mysql_select_db("ycomment") or die(mysql_error());
echo "DBSelected!";
//the real stuff. oh yeah.
$show = mysql_query("SELECT * FROM comments");
echo "Query made!";
$result = mysql_query($show) or die(mysql_error());
while($show = mysql_fetch_array($result)) {
$name = $show['name'];
$commment = $row['comment'];
echo "Name: $name";
echo "Comment: $comment";
}
?>