Location: PHPKode > projects > EasyFest > new/delete_answer.php
	header("Expires: Thu, 17 May 2001 10:17:17 GMT");    // Date in the past
	header ("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); // always modified
	header ("Cache-Control: no-cache, must-revalidate");  // HTTP/1.1
	header ("Pragma: no-cache");                          // HTTP/1.0              
		if($_SESSION["adminloggedIn"] == FALSE){
//$sql1="SELECT * FROM $tbl_name ORDER BY (id) DESC";
// OREDER BY id DESC is order result by descending
//$result = MYSQL_QUERY($sql1);

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252" />
<title>Easy Fest</title>
$result1 = mysql_fetch_array(mysql_query("SELECT a_name from $TableName WHERE question_id=$id"));
//$query="DELETE from Polls WHERE PollId=$PollId";
$query1=mysql_fetch_array(mysql_query("select UserName FROM users WHERE Type=0"));
if($UserName==$query1[0] || $UserName==$result1['a_name']){
//$query = mysql_query("DELETE FROM forum_question WHERE id=$id");
$sql="SELECT MAX(a_id) AS Maxa_id FROM $TableName WHERE question_id='$id'";
if ($rows) {
     $Max_id = $rows['Maxa_id']-1;
                    $sql3="UPDATE $tbl_name2 SET reply='$Max_id' WHERE id='$id'";
$query2= mysql_query("DELETE from $TableName where question_id=$id and a_id=$a_id");
					  $sql4="UPDATE $TableName SET a_id='$value' WHERE question_id='$id' and a_id='$a_id1';";


//$query2=mysql_query("Drop table $TableName");
//$query2=mysql_query("Drop table $TableName");*/ 
<script type="text/javascript">
window.location = "main_forum.php"; 
<?php }
echo "you are not authorised to delete this poll";
Return current item: EasyFest