参数 | 描述 |
---|---|
data | 必需。要使用的数据指针。该数据指针是从 mysql_query() 返回的结果。 |
<?php
$con = mysql_connect("localhost", "peter", "abc123");
if (!$con)
{
die(Could not connect: . mysql_error());
}
$db_selected = mysql_select_db("test_db",$con);
$sql = "SELECT * from Person WHERE Lastname=Refsnes";
$result = mysql_query($sql,$con);
print_r(mysql_fetch_row($result));
print_r(mysql_fetch_lengths($result)
);
mysql_close($con);
?>
输出:
Array ( [0] => Adams [1] => John [2] => London ) Array ( [0] => 5 [1] => 4 [2] => 6 )
制作:
http://www.7di.net 生活网搜集整理 参考: http://www.w3school.com.cn/php/func_mysql_fetch_lengths.asp |