当前位置: 动力学知识库 > 问答 > 编程问答 >

php - jqgrid insert data into another table

问题描述:

This is my script line in INDEX.PHP

editurl: "update.php"

this is my update.php code ,here i commented the update code into same table it is working fine ,but when i try to insert same data into another table it is not working i do nt know why? can you please guys help me to come out of this problem

<?php

session_start();

$session = $_SESSION["id"];

$con = mysqli_connect("localhost", "user", "pass", "DB");

$sql = "INSERT INTO UpdatesTB(Req_Date, App_WeekBeginning, Req_Day, App_Week, Req_Time, Requestor_Login, Employee_Login, Change_Type, New_Value, Requestor_NOTES, WF_Comments, R_Location, WF_Analyst, Approve_Reject, Function) VALUES ('date('Y-m-d')','','date('I')', '', 'date('h:i:sa')','$session','$Login','','','','','$SITE','','','$Function')";

//$sql = "UPDATE EmpMasterTB SET WeekBeginning='$WeekBeginning', SITE='$SITE', Name ='$Name', WFH='$WFH', Manager_Login='$Manager_Login', Lead='$Lead', Cost_center='$Cost_center', Business_Title='$Business_Title', Function='$Function', Workgroup='$Workgroup', Login_time='$Login_time', ROLE='$ROLE', Secondary_Skill='$Secondary_Skill', Weekoff='$Weekoff' WHERE WeekNo = '$WeekNo' AND Login = '$Login' ";

mysqli_query($con,$sql) or die(mysqli_error($con));

mysqli_close($con);

?>

分享给朋友:
您可能感兴趣的文章:
随机阅读: