Merge pull request #36 from banditsmile/bugfix/bandit/compress_update

数据库更新bug修复
pull/39/merge
Mr.zou 2019-03-15 11:51:49 +08:00 committed by GitHub
commit 72c1b3abab
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -22,7 +22,7 @@
public function compress($id){
$id = strip_tags($id);
$id = (int)$id;
$sql = "UPDATE img_images SET `compression` = 1";
$sql = "UPDATE img_images SET `compression` = 1 WHERE imgid={$id}";
$query = $this->db->query($sql);
if($query){
return TRUE;
@ -33,9 +33,9 @@
}
//更新站点信息
public function site($name,$data){
$id = strip_tags($name);
$name = strip_tags($name);
$sql = "UPDATE img_options SET `values` = '$data' WHERE `name` = '$name'";
$sql = "UPDATE img_options SET `values` = '$data' WHERE `name` = '{$name}'";
$query = $this->db->query($sql);
if($query){
return TRUE;