Hello, I have this script for processing my shoutbox, however it comes up with this error when i click submit: Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in /home/oltvkwrk/public_html/Changeable/Rightside.php on line 104 and row 104 is: // button has been submited so processs data $result = mysql_query("SELECT * FROM shoutbox ORDER BY id DESC LIMIT 1"); [b]while ($row = mysql_fetch_row($result)) {[/b] if ($row[2] != $message) { Here is my full code... [code] // Delte shoutbox row if over 100 $result = mysql_query("SELECT * FROM shoutbox"); $max_shouts = 100; if (mysql_num_rows($result) > $max_shouts){ while (mysql_num_rows($result) > $max_shouts){ $get_last_row = mysql_query("SELECT * FROM shoutbox ORDER BY id asc limit 1"); while ($row = mysql_fetch_row($get_last_row)){ $delete_row = mysql_query("DELETE FROM shoutbox WHERE id=$row[0]"); $result = mysql_query("SELECT * FROM shoutbox"); } } } ?> </span> <? if (empty($message)) { $message = "No message left."; } if (empty($name)) { $name = "Anonymous"; } if (isset($_POST['submit'])){ // button has been submited so processs data $result = mysql_query("SELECT * FROM shoutbox ORDER BY id DESC LIMIT 1"); while ($row = mysql_fetch_row($result)) { if ($row[2] != $message) { // assign the ip $ip = $_SERVER['REMOTE_ADDR']; // inserting it into the shoutbox table which we made in the mysql statements before $result = mysql_query("INSERT INTO shoutbox (id,name,message,ip) VALUES ('NULL','$name', '$message', '$ip')"); } } } //returning the last 5 messages $result = mysql_query("SELECT * FROM shoutbox order by id desc limit 10"); //the while loop while($r=mysql_fetch_array($result)) { //getting each variable from the table $id=$r["id"]; $message=$r["message"]; $name=$r["name"]; ?>[/code] Any ideas?? Cheers, Chris