session_start(); $Category="SCS"; include("header.php"); //echo $No; //echo $s_User; //echo $s_User; if (!isset($s_User) || ($s_Ustatus==0) ) { header("location:webboard.php"); exit(); } include("config.inc.php"); //$from =$_ENV["COMPUTERNAME"]; mysql_connect($host,$user,$passwd); mysql_select_db($dbname); if ($mode=="Q") { $sqlQ_pic ="select imgpath from $smf_data where No='$No' and imgpath <> '' "; $sqlA_pic= "select imgpath2 from $smf_ans where QuestionNo='$No' and imgpath2 <> '' "; $resultQ_pic = mysql_query($sqlQ_pic); $resultQ_pic_row = mysql_num_rows($resultQ_pic); $resultA_pic = mysql_query($sqlA_pic); $resultA_pic_row = mysql_num_rows($resultA_pic); // วนลูปลบภาพทั้งหมด if ($resultQ_pic_row > 0) { while($row1 = mysql_fetch_array($resultQ_pic)){ unlink("$row1[imgpath]"); } } if ($resultA_pic_row > 0) { while($row2 = mysql_fetch_array($resultA_pic)){ unlink("$row2[imgpath2]"); } } $sqlQ = "delete from $smf_data where No='$No' "; $sqlA = "delete from $smf_ans where QuestionNo='$No' "; $resultQ = mysql_query($sqlQ); $resultA = mysql_query($sqlA); } else if ($mode=="A") { $sqlA_pic ="select imgpath2 from $smf_ans where QuestionNo='$No' and No='$QuestionNo' and imgpath2 <> '' "; $resultA_pic = mysql_query($sqlA_pic); $resultA_pic_row = mysql_num_rows($resultA_pic ); // วนลูปลบภาพทั้งหมด if ($resultA_pic_row > 0) { while($row = mysql_fetch_array($resultA_pic)){ unlink("$row[imgpath2]"); } } $sqlA = "delete from $smf_ans where QuestionNo='$No' and No='$QuestionNo' "; $resultA = mysql_query($sqlA); $sqlReply= "update $smf_data set Reply=Reply-1 where No='$No' "; $resultReply = mysql_query($sqlReply); } ?>
กระดานสนทนา
ShortChargeShock.com
|