在php与mysql数据库查询我总结了四种方法mysql_result(),mysql_fetch_row(),mysql_fetch_array(),mysql_fetch_object(),四种办法,下面我们一个个来测试并看那个性能最好.
1.使用mysql_result()来获取数据,代码如下:
<?php
$connection=mysql_connect("localhost","root","password"); //连接并选择数据库服务器
mysql_select_db("test",$connection); ...