|
 |
|
insert ข้อมูล 1 record แต่ลงฐานข้อมูล 2 record ร้อนใจค่ะแก้ไม่ไดซะที |
|
 |
|
|
 |
 |
|
พี่ค่ะถ้าหากว่าเราเพิ่มข้อมูลลงในฐานข้อมูลอ1record แต่ลงฐานข้อมุล 2record
ข้อมูลตัวเดียวกันต่างกันที่ booking_id เพราะมันจะรันแบบ ออโตอินคลีเมน
เกิดจากไรค่ะแก้ยังไงก็ไม่หายซะที
code insert ค่ะ
<?php
require_once("../include/chkSession.php");
require_once("../include/connectdb.php");
mysql_select_db($dbname1);
$charset = "SET NAMES 'tis620'";
mysql_query($charset);
$room_id = $_POST[room_id];
$user_id = $_POST[user_id];
$user_name = $_POST[user_name];
$spec_requirement=$_POST[spec_requirement];
$booking_date=$_POST[booking_date];
$date_start= $_POST["date_start"];
$date_end= $_POST["date_end"];
$booking_time= $_POST["booking_time"];
$amount_person_attend= $_POST["amount_person_attend"];
$reason_reserve= $_POST["reason_reserve"];
$approve_id= '04';
$spec_requirement=$_POST[spec_requirement];
$reason_reserve=$_POST[reason_reserve];
$amount_person_attend=$_POST[amount_person_attend];
$charset = "SET NAMES 'tis620'";
mysql_query($charset);
$sqlinsert="insert into booking (room_id, user_id, user_name, spec_requirement, booking_date, date_start, date_end, book_time_id, amount_person_attend, reason_reserve, approve_id )
values ('$room_id','$user_id','$user_name','$spec_requirement','$booking_date','$date_start','$date_end','$booking_time','$amount_person_attend','$reason_reserve','04')";
//echo "<br>";
$qu=mysql_query($sqlinsert);
?>
<script type="text/javascript">
alert('Add OK');
window.location='bookingReport2_user.php';
</script>
Tag : - - - -

|
|
 |
 |
 |
 |
Date :
2010-03-13 16:28:35 |
By :
tonlhiew |
View :
872 |
Reply :
1 |
|
 |
 |
 |
 |
|
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ลองแบบนี้
ตรงสุดท้ายหน่ะครับ
$qu=mysql_query($sqlinsert);
?>
<script type="text/javascript">
alert('Add OK');
window.location='bookingReport2_user.php';
</script>
เป็น
$qu=mysql_query($sqlinsert);
if($qu){
?>
<script>alert('Add OK');window.location.href='bookingReport2_user.php';</script>
<?php
exit();
}
?>
คาราเมลดอทคอม msn:[email protected]
|
 |
 |
 |
 |
Date :
2010-03-13 16:40:57 |
By :
kalamell |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|
|

|
Load balance : Server 02
|