 |
|
ผมพยายามจะบันทึก 3 ตารางพร้อมกัน บันทึกตาราง 1 ได้แล้วเหลือ 2 กับ 3
มันไม่บันทึกให้ครับมันฟ้องตรงที่ผมเขียน OR DIE เลยครับ รบกวนผู้รู้ชี้แนะทีครับ
Code (PHP)
<?
include ("connectDB.php");
if(trim($_POST["name"]) == "")
{
echo "กรุณากรอกชื่อผู้ใช้!";
echo "<br> <a href='patient.php'>กลับไปยังหน้าเดิม</a>";
exit();
}
if(trim($_POST["hn"]) == "")
{
echo "กรุณากรอกHN!";
echo "<br> <a href='patient.php'>กลับไปยังหน้าเดิม</a>";
exit();
}
if(trim($_POST["registration"]) == "")
{
echo "กรุณากรอกเลขทะเบียน!";
echo "<br> <a href='patient.php'>กลับไปยังหน้าเดิม</a>";
exit();
}
$date = gmdate ( "d/M/y", time() );
$strSQL = "INSERT INTO patient (reg,name_lastname,HN,DateIN,f_left,f_ulcers,f_cute,f_shoes,f_nail,f_deformities,f_warmth,f_skin,f_infarction,f_right,f_history,f_sensation,f_wart_corh,f_hairloss,f_fungi,f_feeling,notes) VALUES ('".$_POST["registration"]."',
'".$_POST["name"]."','".$_POST["hn"]."','".$date."','".$_POST["left"]."','".$_POST["left2"]."','".$_POST["left3"]."','".$_POST["shoes"]."','".$_POST["left4"]."','".$_POST["left5"]."','".$_POST["left6"]."','".$_POST["left7"]."','".$_POST["left8"]."','".$_POST["right1"]."','".$_POST["right2"]."','".$_POST["right3"]."','".$_POST["right4"]."','".$_POST["right5"]."','".$_POST["right6"]."','".$_POST["right7"]."','".$_POST["notes"]."')" or die ("insert ข้อมูลลง Table ไม่ได้ ");
mysql_query("SET character_set_results=tis620");
mysql_query("SET character_set_client=tis620");
mysql_query("SET character_set_connection=tis620");
mysql_query("SET collation_connection = tis620_thai_ci");
mysql_query("SET collation_database = tis620_thai_ci");
mysql_query("SET collation_server = tis620_thai_ci");
$objQuery = mysql_query($strSQL);
mysql_query ("INSERT INTO poter_data (id,left,right) VALUES ('".$_POST["registration"]."','".$_POST["left9"]."','".$_POST["right10"]."')")or die ("insert ข้อมูลลง Table poter_data ไม่ได้ ");
mysql_query ("INSERT INTO dorsa_data (id,left,right) VALUES ('".$_POST["registration"]."','".$_POST["left11"]."','".$_POST["right12"]."')") or die ("insert ข้อมูลลง Table dorsa_data ไม่ได้ ");
echo "กรอกข้อมูลเรียบร้อย!<br>";
mysql_close();
?>
Tag : PHP, MySQL, HTML/CSS
|
ประวัติการแก้ไข 2013-10-13 15:29:25 2013-10-13 15:29:54 2013-10-13 15:36:58
|
 |
 |
 |
 |
Date :
2013-10-13 15:28:53 |
By :
MaliNo |
View :
738 |
Reply :
3 |
|
 |
 |
 |
 |
|
|
|
 |