|
|
รูปแบบการกรอกข้อมูลแบบสอบถามมีทั้งหมด 3 หน้า ซึ่งจะทำการบันทึกค่าทั้ง3 หน้าลงฐานข้อมูลแต่บันทึกได้หน้าเดี่ยวคือหน้าที่ 3
ตัวอย่างโค้ดที่เขียนรบกวนช่วยดูให้หน่อยนะคะ
<?php
//include ("connection.php")
$conn=mysql_connect("localhost","root","mysql");
mysql_select_db("db_com",$conn);
$Institution =$_POST['Institution'];
$Date =$_POST['Date'];
$TIME =$_POST['TIME'];
$Event =$_POST['Event'];
$Age =$_POST['Age'];
$Sex =$_POST['Sex'];
$Diagnose =$_POST['Diagnose'];
$Physicians =$_POST['Physicians'];
$HN =$_POST['HN'];
$AN =$_POST['AN'];
$A1 =$_POST['A1'];
$A2 =$_POST['A2'];
$A3 =$_POST['A3'];
$A4 =$_POST['A4'];
$A5 =$_POST['A5'];
$A6 =$_POST['A6'];
$A7 =$_POST['A7'];
$A8 =$_POST['A8'];
$A9 =$_POST['A9'];
$A10 =$_POST['A10'];
$A11 =$_POST['A11'];
$A12 =$_POST['A12'];
$A13 =$_POST['A13'];
$A14 =$_POST['A14'];
$A15 =$_POST['A15'];
$A16 =$_POST['A16'];
$A17 =$_POST['A17'];
$A18 =$_POST['A18'];
$A19 =$_POST['A19'];
$A20 =$_POST['A20'];
$A21 =$_POST['A21'];
$A22 =$_POST['A22'];
$B1 =$_POST['B1'];
$B2 =$_POST['B2'];
$B3 =$_POST['B3'];
$B3 =$_POST['B4'];
$C1 =$_POST['C1'];
$C2 =$_POST['C2'];
$C3 =$_POST['C3'];
$C4 =$_POST['C4'];
$C5 =$_POST['C5'];
$C6 =$_POST['C6'];
$C7 =$_POST['C7'];
$C8 =$_POST['C8'];
$C9 =$_POST['C9'];
$C10 =$_POST['C10'];
$C11 =$_POST['C11'];
$C12 =$_POST['C12'];
$C13 =$_POST['C13'];
$D1 =$_POST['D1'];
$D2 =$_POST['D2'];
$D3 =$_POST['D3'];
$D4 =$_POST['D4'];
$D5 =$_POST['D5'];
$D6 =$_POST['D6'];
$E1 =$_POST['E1'];
$E2 =$_POST['E2'];
$E3 =$_POST['E3'];
$E4 =$_POST['E4'];
$E5 =$_POST['E5'];
$E6 =$_POST['E6'];
$F1 =$_POST['F1'];
$F2 =$_POST['F2'];
$F3 =$_POST['F3'];
$F4 =$_POST['F4'];
$F5 =$_POST['F5'];
$F6 =$_POST['F6'];
$F7 =$_POST['F7'];
$G1 =$_POST['G1'];
$G2 =$_POST['G2'];
$H1 =$_POST['H1'];
$H2 =$_POST['H2'];
$H3 =$_POST['H3'];
$H4 =$_POST['H4'];
$H5 =$_POST['H5'];
$H6 =$_POST['H6'];
$H7 =$_POST['H7'];
$H8 =$_POST['H8'];
$H9 =$_POST['H9'];
$H10 =$_POST['H10'];
$H11 =$_POST['H11'];
$H12 =$_POST['H12'];
$H13 =$_POST['H13'];
$H14 =$_POST['H14'];
$H15 =$_POST['H15'];
$H16 =$_POST['H16'];
$H17 =$_POST['H17'];
$H18 =$_POST['H18'];
$H19 =$_POST['H19'];
$H20 =$_POST['H20'];
$H21 =$_POST['H21'];
$H22 =$_POST['H22'];
$H23 =$_POST['H23'];
$H24 =$_POST['H24'];
$H25 =$_POST['H25'];
$H26 =$_POST['H26'];
$H27 =$_POST['H27'];
$H28 =$_POST['H28'];
$H29 =$_POST['H29'];
$H30 =$_POST['H30'];
$H31 =$_POST['H31'];
$H32 =$_POST['H32'];
$H33 =$_POST['H33'];
$H34 =$_POST['H34'];
$sql = "INSERT INTO formhai(Institution,Date,TIME,Event,Age,Sex,Diagnose,Physicians,HN,AN,A1,A2,A3,A4,A5,A6,A7,A8,A9,A10,A11,A12,A13,A14,A15,A16,A17,A18,A19,A20,A21,A22,B1,B2,B3,B4,C1,C2,C3,C4,C5,C6,C7,C8,C9,C10,C11,C12,C13,D1,D2,D3,D4,D5,D6,E1,E2,E3,E4,E5,E6,F1,F2,F3,F4,F5,F6,F7,G1,G2,H1,H2,H3,H4,H5,H6,H7,H8,H9,H10,H11,H12,H13,H14,H15,H16,H17,H18,H19,H20,H21,H22,H23,H24,H25,H26,H27,H28,H29,H30,H31,H32,H33,H34)values('$Institution','$Date','$TIME','$Event','$Age','$Sex','$Diagnose','$Physicians','$HN','$AN','$A1','$A2','$A3','$A4','$A5','$A6','$A7','$A8','$A9','$A10','$A11','$A12','$A13','$A14','$A15','$A16','$A17','$A18','$A19','$A20','$A21','$A22','$B1','$B2','$B3','$B4','$C1','$C2','$C3','$C4','$C5','$C6','$C7','$C8','$C9','$C10','$C11','$C12','$C13','$D1','$D2','$D3','$D4','$D5','$D6','$E1','$E2','$E3','$E4','$E5','$E6','$F1','$F2','$F3','$F4','$F5','$F6','$F7','$G1','$G2','$H1','$H2','$H3','$H4','$H5','$H6',
'$H7','$H8','$H9','$H10','$H11','$H12','$H13','$H14','$H15','$H16','$H17','$H18','$H19','$H20','$H21','$H22','$H23','$H24','$H25','$H26','$H27','$H28','$H29','$H30','$H31','$H32','$H33','$H34')";
if(mysql_query($sql,$conn)){
echo"record added!";
}else{
echo"Error:",mysql_error();
}
?>
รบกวนด้วยนะคำมือใหม่
Tag : PHP
|
|
|
|
|
|
Date :
2010-10-05 15:37:46 |
By :
janjira0019 |
View :
1621 |
Reply :
3 |
|
|
|
|
|
|
|
|
|