欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

PHP mysql_fetch_lengths() 函數(shù)

定義和用法

mysql_fetch_lengths() 函數(shù)取得一行中每個字段的內(nèi)容的長度。

行是由這些函數(shù)返回的:mysql_fetch_array()、mysql_fetch_assoc()、mysql_fetch_object()mysql_fetch_row()。

若成功,則該函數(shù)返回一個數(shù)字數(shù)組,若出錯或沒有其他的行,則返回 false。

語法

mysql_fetch_lengths(data)
參數(shù) 描述
data 必需。要使用的數(shù)據(jù)指針。該數(shù)據(jù)指針是從 mysql_query() 返回的結(jié)果。

例子

<?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
)