|
|
|
ขอสอบถามหน่อยคับผม insert ไม่เข้าเลยครับไม่รู้ว่าผิดตรงไหน |
|
|
|
|
|
|
|
Code (PHP)
<?php
session_start();
include('include/config.php');
include('include/function.php');
?>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<?php
if($_POST['action']=="adds_tag_durable")
{
$tag_du_id = $_POST['tag_du_id'];
$id = $_POST['id'];
$tag_du_number = $_REQUEST['tag_du_number'];
$tag_du_cost = $_REQUEST['tag_du_cost'];
$work_du_id = $_REQUEST['work_du_id'];
$tag_du_note = $_REQUEST['tag_du_note'];
$tag_du_start = $_REQUEST['tag_du_start'];
$tag_du_end = $_REQUEST['tag_du_end'];
$tag_du_percen = $_REQUEST['tag_du_percen'];
$tag_du_comment = $_REQUEST['tag_du_comment'];
$sql = mysql_query("insert into tag_work_durable set id = '$id' , tag_du_number = '$tag_du_number' , tag_du_cost = '$tag_du_cost' , work_du_id = '$work_du_id' , tag_du_note = '$tag_du_note' , tag_du_start = '$tag_du_start' , tag_du_end = '$tag_du_end' , tag_du_percen = '$tag_du_percen' , tag_du_comment = '$tag_du_comment' ,last_update = now()");
if($sql){
$sql2 = mysql_query("insert into tag_work_durable_2 set id = '$id' , tag_du_number = '$tag_du_number' , tag_du_cost = '$tag_du_cost' , work_du_id = '$work_du_id' , tag_du_note = '$tag_du_note' , tag_du_start = '$tag_du_start' , tag_du_end = '$tag_du_end' , tag_du_percen = '$tag_du_percen' , tag_du_comment = '$tag_du_comment' ,last_update = now()");
if ($sql2) {echo "";}
else {echo "ERROR: " . $sql . "<br>" . $conn->error;}
}
else {echo "Error1: " . $sql . "<br>" . $conn->error;}
exit("<script>alert('เพิ่มข้อมูลเรียบร้อยแล้ว');window.location=\"system_index_details_durable.php?id=$id\";</script>");
}
?>
เวลา insert เข้าไปมันขึ้น Error1 ขึ้นมาคับไม่ยอมบอก ว่า error ตรงไหน
Tag : PHP, MySQL
|
|
|
|
|
|
Date :
2015-04-10 12:15:20 |
By :
stepartz |
View :
658 |
Reply :
1 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ลองให้มันแสดง Error ออกมาดูครับ
Code (PHP)
$sql = mysql_query("insert into tag_work_durable set id = '$id' , tag_du_number = '$tag_du_number' , tag_du_cost = '$tag_du_cost' , work_du_id = '$work_du_id' , tag_du_note = '$tag_du_note' , tag_du_start = '$tag_du_start' , tag_du_end = '$tag_du_end' , tag_du_percen = '$tag_du_percen' , tag_du_comment = '$tag_du_comment' ,last_update = now()") or die(mysql_error());
|
|
|
|
|
Date :
2015-04-10 13:43:32 |
By :
arm8957 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 02
|