-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUpdate.php
More file actions
49 lines (44 loc) · 1.35 KB
/
Update.php
File metadata and controls
49 lines (44 loc) · 1.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
<?php
/**
* Created by PhpStorm.
* User: E567802
* Date: 6/29/2017
* Time: 18:03
*/
require "Define.php";
$id = trim($_REQUEST['thisid']);
$thisclass = trim($_REQUEST['thisclass']);
$thisvalue= trim($_REQUEST['thisvalue']);
#error_log($id."###\n" ,3 ,"sql.log");
#error_log($thisclass."###\n" ,3 ,"sql.log");
#error_log($thisvalue."###\n" ,3 ,"sql.log");
if (substr_count($thisclass," ")>0){
$thisclass=str_replace(" ","",$thisclass);
}
if (substr_count($thisclass,"input")>0){
$thisclass=str_replace("input","",$thisclass);
}
$update_sql = "update Build_Data set $thisclass='$thisvalue' where Build_Id='$id'";
error_log($update_sql."###\n" ,3 ,"sql.log");
if (!mysqli_query($dbc,$update_sql)) {
printf ("Error Message: %s\n", mysqli_error($dbc));
}
#header("refresh:0;url=SelectData.php");
/*
// include_once("connect.php"); //连接数据库
$id=$_POST['id'];
$field=$_POST['field']; //获取前端提交的字段名
$val=$_POST['value']; //获取前端提交的字段对应的内容
$val = htmlspecialchars($val, ENT_QUOTES); //过滤处理内容
// $time=date("Y-m-d H:i:s"); //获取系统当前时间
if(empty($val)){
echo "please input a value";
}else{
//更新字段信息
$query=mysqli_query($dbc,"update Build_Data set $field = '$val' where id=$id");
if(!$query){
printf ("Error Message:%s\n",mysqli_error($dbc));
}
}
*/
?>