From view_profile.php <form name="delete" method="get" action="modpanel.php"> <input type="hidden" name="id" value="<?= $rows['id'] ?>"> <input type="hidden" name="postsdump" value="1"> <input type="submit" name="Submit" value="Delete" class="button"> Deletes the users posts </form> HTML: modpanel.php <?php require('config.php'); if(!in_array($_SESSION['username'],$admin_users)) die('You do not have permission to delete users.'); // get value of id that sent from address bar $id=mysql_real_escape_string($_GET['id']); $sql="SELECT * FROM {$db_prefix}user WHERE id='$id'"; $rows=mysql_fetch_array(mysql_query($sql)); if(in_array($name,$admin_users)) die('You cannot delete yourself'); if (!$rows) die("This user does not exist."); $name=$rows['username']; if($_GET['postsdump']) { $sql = "DELETE FROM {$db_prefix}question WHERE name='$name'"; $result2=mysql_query($sql)or die(mysql_error()); $sql = "SELECT * FROM {$db_prefix}answer WHERE a_name='$name'"; $result3=mysql_query($sql) or die(mysql_error()); while($rows=mysql_fetch_array($result3)) { $sql = "DELETE FROM {$db_prefix}answer WHERE a_id='".$rows['a_id']."' AND question_id='".$rows['question_id']."'"; $result=mysql_query($sql) or die(mysql_error()); $sql = "UPDATE {$db_prefix}question SET reply=reply-1 WHERE id='".$rows['question_id']."'"; $result2=mysql_query($sql) or die(mysql_error()); } } else { $result2 = 1; $result3 = 1; } if($result && $result2 && $result3){ header("Location: members.php"); } else { echo "ERROR"; } ?> PHP: Im getting the word "ERROR" so im guessing its not getting postsdump help? edit: I took out the second result2 and replaced it with result4 and changed the code accordingly. didnt fix it. so i set it back waiting on a reply