public static function mquery($sql){
$conn = self::db_connect();
$rs=mysqli_query($conn,$sql);
mysqli_close($conn);
public static function insert ($table,$data){
$conn=self::db_connect();
$fields = array();
$values = array();
foreach ($data as $key => $value) {
$value = str_replace("'", '&apos', $value);//单引号替换字符实体
$value = str_replace(''', '"', $value);/ /双引号替换
$fields[]= "`".$key."`";
$values[]="'".$value."'";
}
$fields = implode(',', $fields);
$values = implode(',',$values);
//sql 语句
$sql = "insert into {$table} ({$fields}) Werte ({$Werte})";
//dump($sql);exit();
$insert_id =0;
if (mysqli_query( $conn,$sql)){
$insert_id = mysqli_insert_id ($conn);
}
mysqli_close($conn);
return $insert_id;
}
return $rs;
}
如果mysqli_query换成self::mquery() mysqli_insert_id (这里应该传入什么呢)