|
|
|
มีใครเคย เพิ่มข้อ 2 ตารางพร้อมกันบ้าง ช่วยดูให้ที |
|
|
|
|
|
|
|
โค้ดนี่เพิ่มได้เฉพาะ ตาราง teacher เท่าตารางsettiemไม่เพิ่มเลย แล้วโค้ดก็ไม่ได้ error ไร เลย
Code (PHP)
<?
include "../config.in.php";
$Teacher_Pass=md5($_POST['Teacher_Pass']);
$sql="insert into teacher (Teacher_Prefix,Teacher_Fname,Teacher_Lname,Teacher_Position,Teacher_Tel,Teacher_Email,pass)values('$Teacher_Prefix','$Teacher_Fname','$Teacher_Lname','$Teacher_Position','$Teacher_Tel','$Teacher_Email','$Teacher_Pass')";
$sql= "INSERT INTO settime (Date_Booking,Post_Date,Teacher_ID) VALUES ('0',now(),$Teacher_Email)";
$sql= "INSERT INTO settime (Date_Booking,Post_Date,Teacher_ID) VALUES ('1',now(),$Teacher_Email)";
$sql= "INSERT INTO settime (Date_Booking,Post_Date,Teacher_ID) VALUES ('2',now(),$Teacher_Email)";
$sql= "INSERT INTO settime (Date_Booking,Post_Date,Teacher_ID) VALUES ('3',now(),$Teacher_Email)";
$sql= "INSERT INTO settime (Date_Booking,Post_Date,Teacher_ID) VALUES ('4',now(),$Teacher_Email)";
$sql= "INSERT INTO settime (Date_Booking,Post_Date,Teacher_ID) VALUES ('5',now(),$Teacher_Email)";
$sql= "INSERT INTO settime (Date_Booking,Post_Date,Teacher_ID) VALUES ('6',now(),$Teacher_Email)";
$query=mysql_query($sql);
if($query){
?>
<script>
alert("เพิ่มข้อมูล เรียบร้อยแล้ว");
</script>
<?
}else{
?> <?
include "../config.in.php";
$Teacher_Pass=md5($_POST['Teacher_Pass']);
$sql="insert into teacher (Teacher_Prefix,Teacher_Fname,Teacher_Lname,Teacher_Position,Teacher_Tel,Teacher_Email,pass)values('$Teacher_Prefix','$Teacher_Fname','$Teacher_Lname','$Teacher_Position','$Teacher_Tel','$Teacher_Email','$Teacher_Pass')";
$sql= "INSERT INTO settime (Date_Booking,Post_Date,Teacher_ID) VALUES ('0',now(),$Teacher_Email)";
$sql= "INSERT INTO settime (Date_Booking,Post_Date,Teacher_ID) VALUES ('1',now(),$Teacher_Email)";
$sql= "INSERT INTO settime (Date_Booking,Post_Date,Teacher_ID) VALUES ('2',now(),$Teacher_Email)";
$sql= "INSERT INTO settime (Date_Booking,Post_Date,Teacher_ID) VALUES ('3',now(),$Teacher_Email)";
$sql= "INSERT INTO settime (Date_Booking,Post_Date,Teacher_ID) VALUES ('4',now(),$Teacher_Email)";
$sql= "INSERT INTO settime (Date_Booking,Post_Date,Teacher_ID) VALUES ('5',now(),$Teacher_Email)";
$sql= "INSERT INTO settime (Date_Booking,Post_Date,Teacher_ID) VALUES ('6',now(),$Teacher_Email)";
$query=mysql_query($sql);
if($query){
?>
<script>
alert("เพิ่มข้อมูล เรียบร้อยแล้ว");
</script>
<?
}else{
?>
Tag : PHP, MySQL
|
|
|
|
|
|
Date :
2011-02-02 12:50:58 |
By :
ckcr |
View :
823 |
Reply :
2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ที่เห็น ก็ คำสั่งเพิ่ม ใน ตาราง teacher ทั้งคู่ อ้างอิงจาก บรรทัดที่ 4 และ 25
|
|
|
|
|
Date :
2011-02-02 14:07:29 |
By :
compeng |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Code (PHP)
$sql= "insert into teacher (Teacher_Prefix,Teacher_Fname,Teacher_Lname,Teacher_Position,Teacher_Tel,Teacher_Email,pass)values('$Teacher_Prefix','$Teacher_Fname','$Teacher_Lname','$Teacher_Position','$Teacher_Tel','$Teacher_Email','$Teacher_Pass')";
$sql .= "INSERT INTO settime (Date_Booking,Post_Date,Teacher_ID) VALUES ('0',now(),$Teacher_Email)";
$sql .= "INSERT INTO settime (Date_Booking,Post_Date,Teacher_ID) VALUES ('1',now(),$Teacher_Email)";
$sql .= "INSERT INTO settime (Date_Booking,Post_Date,Teacher_ID) VALUES ('2',now(),$Teacher_Email)";
$sql .= "INSERT INTO settime (Date_Booking,Post_Date,Teacher_ID) VALUES ('3',now(),$Teacher_Email)";
$sql .= "INSERT INTO settime (Date_Booking,Post_Date,Teacher_ID) VALUES ('4',now(),$Teacher_Email)";
$sql .= "INSERT INTO settime (Date_Booking,Post_Date,Teacher_ID) VALUES ('5',now(),$Teacher_Email)";
$sql .= "INSERT INTO settime (Date_Booking,Post_Date,Teacher_ID) VALUES ('6',now(),$Teacher_Email)";
ลองแบบนี้ดูครับ
|
|
|
|
|
Date :
2011-02-02 16:04:00 |
By :
judar |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 02
|