mysqli和mysql的三种单条信息查询方式实例
这是mysqli面向对象方法
$db=new mysqli('localhost','root','','test');
$db->set_charset("utf8");
$uid=$_GET['id'];
$sql="select * from gh where id = 3";
$se=$db->query($sql);
$se=$se->fetch_array();
var_dump($se);
mysqli面向过程方法
$db=mysqli_connect('localhost','root','','test');
mysqli_set_charset($db,"utf8");
$se=mysqli_query($db,"select * from gh where id = 3");
$se=mysqli_fetch_array($se);
mysql链接数据库查询方法
$conn=mysql_connect("localhost","root","");
mysql_select_db('test');
mysql_query("set names 'utf8'");
$se=mysql_query("select * from gh where id = 3");
$se=mysql_fetch_array($se);