当前位置:Gxlcms > PHP教程 > php+mysqlmysql_fetch_lengths教程_PHP教程

php+mysqlmysql_fetch_lengths教程_PHP教程

时间:2021-07-01 10:21:17 帮助过:3人阅读

mysql_fetch_lengths 的作用是判断mysql_fetch_array ( ) , mysql_fetch_assoc ( ) , mysql_fetch_object ( )或mysql_fetch_row ( )的长度,如果成功就返回一个陈列,否则就返回false;

mysql_fetch_lengths的语法.

mysql_fetch_lengths(data)
参数.
data:必选就是mysql_query返回的值
来我们来看看实例.

$sql = "SELECT * from Person WHERE Lastname='Refsnes'";
$result = mysql_query($sql,$con);
print_r(mysql_fetch_row($result));
print_r(mysql_fetch_lengths($result));
?>
输出结果.
Array
(
[0] => Refsnes
[1] => Kai Jim
[2] => Taugata 2
[3] => 22
)
Array
(
[0] => 7
[1] => 7
[2] => 9
[3] => 2
)

www.bkjia.comtruehttp://www.bkjia.com/PHPjc/630896.htmlTechArticlemysql_fetch_lengths 的作用是判断mysql_fetch_array ( ) , mysql_fetch_assoc ( ) , mysql_fetch_object ( )或mysql_fetch_row ( )的长度,如果成功就返回一...

人气教程排行