引进数据
mysql> create database stu1 character set utf8;
mysql> use stu1
mysql> set names utf8;
mysql> source c:/stu1.sql;
连接数据库
<?php $db=new mysqli("localhost","root","","stu1");//连mysql $db->set_charset('utf8'); $sql="select * from grade"; $res = $db->query($sql);//执行查询 echo "一共".$res->num_rows."条数据<br />"; while($row=$res->fetch_row()){ echo $row[3]."-".$row[0]."-".$row[1]."-".$row[2]."<br />"; }