|
 |
|
ช่วยดูโค้ดให้ด้วยครับ ลองแก้ ลองมั่วหลายวันแล้วครับ |
|
 |
|
|
 |
 |
|
ผมอยากให้คนที่ทำเมนูนั้นๆ เสร็จแล้วให้เมนูนั้นๆ หายไป อะครับ ตอนนี้ผมงงการเพิ่มพวกเงื่อนไขการเพิ่ม field อะครับว่าควรจะเพิ่มตรงไหนบ้าง ผมลองทำดูแล้วครับมันไม่ insert สถานะ Y,N เข้าไปใน DB แต่สามารถ insert การทำแบบสอบถามได้ปกติไม่รู้ว่าผมทำผิดตรงไหน รบกวนด้วยนะครับ

Code (PHP)
<?php
session_start();
include('db_con/connect.php');
$sql = mysql_query("select * from tb_user where user_id='$_SESSION[login_true]'") or die ("Err Can not to result") ;
$rows = mysql_fetch_array($sql);
$user = $rows['user_citiid'];
$name = $rows['user_name'];
$strSQL="INSERT INTO tb_question_admin(citizen_id,name,sex,age,edu,work_age,status,service,behavior1 ,behavior2,process1,process2,process3,result1,result2,result3,conclude,comment)
VALUES
('$user','$name','$_POST[sex]','$_POST[age]', '$_POST[edu]','$_POST[work]','$_POST[status]','$_POST[service]' ,'$_POST[behavior1]','$_POST[behavior2]','$_POST[process1]', '$_POST[process2]','$_POST[process3]','$_POST[result1]','$_POST[result2]' ,'$_POST[result3]','$_POST[conclude]','$_POST[comment]')";
$objQuery = mysql_query($strSQL);
if($objQuery)
{
echo"<script language='JavaScript'>";
echo"alert('ระบบได้ทำการบันทึกข้อมูลเรียบร้อยแล้ว');";
echo"window.location='../home.php';";
echo"</script>";
}
else
{
echo"<script language='JavaScript'>";
echo"alert('Error :: ไม่สามารถบันทึกข้อมูลได้ [".$strSQL."]');";
echo"</script>";
}
mysql_close($objConnect);
?>
อันนี้โค้ดในการ insert ของแต่ละแบบสอบถามครับ
Tag : PHP, MySQL

|
|
 |
 |
 |
 |
Date :
2013-06-21 13:20:58 |
By :
littlebeer |
View :
693 |
Reply :
1 |
|
 |
 |
 |
 |
|
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
สร้าง tbl มาช่วยเก็บว่า user คนไหน ทำอะไรไป แล้ว ตอน select ไป left join มา น่าจะได้นะคับ
|
 |
 |
 |
 |
Date :
2013-06-21 17:57:17 |
By :
moomoohorn |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|
|

|
Load balance : Server 05
|