<?php $ne=$_POST['name//姓名 $em=$_POST['email」;//邮箱 $sje=$_POST['subject'];//主题 $me=$_POST['message信息 $ne=1;//姓名 $em=2;//邮箱 $sje=3;//主题 $me=4;//信息 //$link = mysqli_connect( // 'localhost', /* The host to connect to 连接MySQL地址 */ // 'root', /* The user to connect as 连接MySQL用户名 */ // 'root', /* The password to use 连接MySQL密码 */ // 'test'); /* The default database to query 连接数据库名称*/ $link = mysqli_connect( '114.116.5.32', /* The host to connect to 连接MySQL地址 */ 'root', /* The user to connect as 连接MySQL用户名 */ '', /* The password to use 连接MySQL密码 */ 'test'); if (!$link) { printf("Can't connect to MySQL Server. Errorcode: %s ", mysqli_connect_error()); exit; } else { echo (数据库已连接!')."<br/>"; /* Close the connection 关闭连接*/ } $sql="INSERT INTO person (name,email,subject,message) VALUES ('$ne','$em','$sje','$me')"; //var_dump($sql);die; //var_dump($link);die; //$result = mysqli_query($link,$sql); for($i =1; $i < 457; $i ){ $result = $link->query($sql); } //$result = $link->query($sql); var_dump($result);die; if($result){ echo "提交成功"; }else{ echo "提交失败";} mysqli_query($link,'set names utf8'); ////解决中文乱码问题 /* Close the connection 关闭连接*/ mysqli_close($link); die;