Home >Backend Development >PHP Tutorial > 各位,帮小弟我优化一下这个SQL语句
各位大虾,帮我优化一下这个SQL语句
各位大虾,帮我优化一下这个SQL语句
$sql = " UPDATE `".$table."` SET $field = concat('".$value['result']."{hx}',now(),'{hx}".$value['name']."{hx}".$value['op']."{hx}".$value['suggestion']."') $auditing WHERE `id`=".$value['id'];
global $conn;
mysql_query($sql,$conn);
if($auditing == ",`check`='yes'"){
$sql = "SELECT `mu_id` FROM `$table` WHERE `id` = $value[id] LIMIT 1";
$sql = mysql_query($sql,$conn);
$mu_id = mysql_fetch_array($sql);
$sql = "UPDATE `member_user` SET `check`='yes',`updatetime`=now() WHERE `id` = $mu_id[0]";
mysql_query($sql,$conn);
}
unset($conn);
return "审批成功";