php 原生mysqli

header("Content-type:text/html; charset=utf-8");
$con = mysqli_connect("localhost", "root", "root");
$arr = array("劉新平","遲磊","李迪","耿建明","蘇曉歌","程春林","王紅婧","張棟良","胡巍","張士軍","鄒鵬","劉菲菲","王輝","李冬","賈瑩","李麗","李夢嬌","鄭立傑","馬奕然","吳長梅","王歡","白玉琳","馬建全","楊永惠","劉艦","滕悅","馬召安","李神引","杜勝利","李榮敏","劉建明","張培民","谷雪","楊明霖","張楠","盧豔","鄭齊");html

mysqli_query($con, "set names utf8");
mysqli_select_db($con, "bss");
mysqli_set_charset($con, "utf-8") ;
foreach($arr as $val){
$sql = "insert into `salesman` set name= '".$val."'";
mysqli_query($con, $sql);
}mysql

相關文章
相關標籤/搜索