手记

PHP MySql插入数组


public function insertData($table,$data){       $field=implode(',', array_keys($data));       foreach (array_values($data) as $key=>$val){        $value .="'".$val."'";        if ($key<count($data)-1)        $value .=",";        }     $sql= "INSERT INTO ".$table."(".$field.") values(".$value.")";        return $this->insert($sql);       }


0人推荐
随时随地看视频
慕课网APP