**ที่หน้าไฟล์ detail.php **ตอบกระทู้
<?
include "connect.php";
include "function1.php";
$ddd=$_POST[submit];
if(trim($ddd)=="บันทึก"){
$sql="select * from tanswer where adate='".trim($_POST['adate'])."' and atime='".trim($_POST['atime'])."' and qid='".$qid."' ";
$result=mysql_query($sql);
$numr=mysql_num_rows($result);
if($numr==0){
$sql=" INSERT INTO tanswer(qid,apost,adetail,adate,aip,atime)
VALUES
('".trim($_POST['qid'])."','".trim($_POST['apost'])."' ,'".trim($_POST['adetail'])."','".trim($_POST['adate'])."','".trim($_POST['aip'])."','".trim($_POST['atime'])."')";
mysql_query($sql); //$result=odbc_exec($conn,$sql);
}
***นี้คือโค๊ดที่ใช้ select คำตอบกระทู้มาโชว์
<?
$sql="select * from tanswer where qid ='".trim($_GET['qid'])."' Order by adate,atime ";ใช้ตัวนี้ Host ทำงานได้
//$sql="select * from tanswer where qid ='".$qid."' Order by adate,atime ";ใช้ตัวนี้คอมทำงานได้
$re=mysql_query($sql);
while ($row=mysql_fetch_array($re)){
?>