include "function.php";
if ($detail_ans=="" or $name_ans=="" ) {
echo "<script>
alert('กรุณากรอกข้อมูลให้ครบ');
window.location='answer_view.php?id_ques=$ref_id'
</script>";
exit();
}
include "connect.php";
$sql="insert into tb_answer values('','$detail_ans','$name_ans','$date_ans','$ref_id','$ip')";
$result=mysql_db_query($dbname,$sql);
if ($result) {
echo "<script>
alert('บันทึกคำตอบเรียบร้อยแล้ว');
window.location='answer_view.php?id_ques=$ref_id'
</script>";
exit();
}