<?php
include("connect.php");
$topic_id = $_GET['topic_id'];
$sql = "DELETE FROM topic AS a INNER JOIN answer AS b ON a.topic_id=b.topic_id WHERE topic_id='$_GET[topic_id]' ";
$result = mysql_query($sql) or die ("sql-".mysql_error());
if($result){
echo "<script>alert('ลบกระทู้คำถามเรียบร้อยแล้วครับ');window.location='index.php';</script>";
}
mysql_close();
?>