|
 |
|
เพิ่มข้อมูลลงฐานข้อมูล ไม่มี error แต่มันไม่เพิ่มลงฐานข้อมูลให้ |
|
 |
|
|
 |
 |
|
เพิ่มข้อมูลแล้วมันไม่มี error แต่ ทำไมไม่ลงฐานข้อมูลล้อง echo ข้อมูลออกมาทุกอันมันก็แสดงงงมากครับ
ไฟล์ connect (PHP)
$mysqli = mysqli_connect('localhost','root','123456789','kiawzastore');
ไฟล์เพิ่ม (PHP)
session_start();
include_once("../cont.php");
$e_name = mysqli_real_escape_string($mysqli,$_SESSION['e_name']);
$e_id = mysqli_real_escape_string($mysqli,$_SESSION['e_id']);
$Product_id = mysqli_real_escape_string($mysqli, $_POST['Product_id']);
$Product_name = mysqli_real_escape_string($mysqli, $_POST['Product_name']);
$Quantity = mysqli_real_escape_string($mysqli, $_POST['Quantity']);
$Manufacturedead_date = mysqli_real_escape_string($mysqli, $_POST['Manufacturedead_date']);
$objResult = mysqli_query($mysqli, "INSERT INTO tbl_manufacture(Product_id,Product_name,Employee_id,Employee_name,Quantity,Manufacture_date,Manufacturedead_date)
VALUES('$Product_id','$Product_name','$e_id','$e_name','$Quantity',NOW(),'$Manufacturedead_date')");
//display success message
echo "<script language=\"JavaScript\" CHARSET=”UTF-8″>";
echo "alert('เพิ่มข้อมูลเสร็จสิ้น');window.location='../sell_page/edit_sell.php';";
echo "</script>";
Tag : PHP

|
ประวัติการแก้ไข 2018-01-02 15:13:17
|
 |
 |
 |
 |
Date :
2018-01-02 15:12:20 |
By :
joekobo |
View :
892 |
Reply :
3 |
|
 |
 |
 |
 |
|
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
Code (PHP)
$objResult = mysqli_query($mysqli, $sql="INSERT INTO tbl_manufacture(Product_id,Product_name,Employee_id,Employee_name,Quantity,Manufacture_date,Manufacturedead_date)
VALUES('$Product_id','$Product_name','$e_id','$e_name','$Quantity',NOW(),'$Manufacturedead_date')")
or die(mysqli_error($mysqli) . "<br>".$sql);
ตรวจเช็ค error หน่อย
|
 |
 |
 |
 |
Date :
2018-01-02 15:47:02 |
By :
Chaidhanan |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|
|

|
Load balance : Server 03
|