Possible Duplicate:
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result
I am receiving the following errors
Warning: mysql_query() [function.mysql-query]: Access denied for user 'anticub1'@'localhost' (using password: NO)
Warning: mysql_query() [function.mysql-query]: A link to the server could not be established
Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource
When I submit the form everything goes into the database so I am not sure why I am getting that error...
<?php
$submit=$_POST['submit'];
$text=$_POST['text'];
if ($submit) {
$connect = mysql_connect("localhost","anticub1_shout","root12")
or die("could not connect");
mysql_select_db("anticub1_shoutbox") or die("could not find the db");
mysql_query("INSERT INTO comments VALUES ('','$text')");}
$query = mysql_query("SELECT * FROM comments");
while ($row = mysql_fetch_assoc($query)) {
$post = $row["posts"];
echo "$post"."<br>";
}
?>
";`. – Lèse majesté Feb 07 '11 at 14:20