|
|
|
สอบถามเกี่ยวกับการ redirect ไปหน้าตามลิ้งที่เรากำหนดพร้อมส่งค่าผ่านลิ้ง |
|
|
|
|
|
|
|
Code (PHP)
include 'connect.php';
$sql = "INSERT INTO passport(Passport_ID,Personnel_ID,Passport_until,ReEntry,Note)
VALUES ('" . $_POST["Passport_ID"] . "','" . $_POST["Personnel_ID"] . "','" . $_POST["Passport_Until"] . "','" . $_POST["ReEntry"] . "','" . $_POST["Note"] . "')";
$query = mysqli_query($conn, $sql);
$sql2 = "INSERT INTO passport_transaction(Passport_ID)
SELECT Passport_ID FROM passport WHERE Personnel_ID ='".$_POST["Personnel_ID"]."'";
$query2 = mysqli_query($conn, $sql2);
if ($query and $query2) {
header("Location:detail.php?Personnel_ID=$Personnel_ID"); // แนะนำผมด้วยครับ
} else {
echo "sql : $sql.<br>.$sql2";
}
mysqli_close($conn);
ระบบเป็นแบบนี้ครับ
Tag : MySQL, HTML, CSS, HTML5, Windows
|
ประวัติการแก้ไข 2020-05-26 13:30:54 2020-05-26 13:31:24 2020-05-26 13:44:54 2020-05-26 13:45:31
|
|
|
|
|
Date :
2020-05-26 13:30:17 |
By :
haliw46 |
View :
691 |
Reply :
1 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ได้แล้วครับ
Code (PHP)
include 'connect.php';
$sql = "INSERT INTO passport(Passport_ID,Personnel_ID,Passport_until,ReEntry,Note)
VALUES ('" . $_POST["Passport_ID"] . "','" . $_POST["Personnel_ID"] . "','" . $_POST["Passport_Until"] . "','" . $_POST["ReEntry"] . "','" . $_POST["Note"] . "')";
$query = mysqli_query($conn, $sql);
$sql2 = "INSERT INTO passport_transaction(Passport_ID)
SELECT Passport_ID FROM passport WHERE Personnel_ID ='" . $_POST["Personnel_ID"] . "'";
$query2 = mysqli_query($conn, $sql2);
$Personnel_ID = $_POST['Personnel_ID']; //เพิ่มส่วนนี้เข้าไป
if ($query and $query2) {
header("Location:detail.php?Personnel_ID=$Personnel_ID");
} else {
echo "sql : $sql.<br>.$sql2";
}
mysqli_close($conn);
|
|
|
|
|
Date :
2020-05-26 13:50:18 |
By :
haliw46 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 04
|