Home > Backend Development > PHP Tutorial > php +mysql mysql_fetch_lengths tutorial_PHP tutorial

php +mysql mysql_fetch_lengths tutorial_PHP tutorial

WBOY
Release: 2016-07-13 17:04:04
Original
1119 people have browsed it

The function of mysql_fetch_lengths is to determine the length of mysql_fetch_array ( ), mysql_fetch_assoc ( ), mysql_fetch_object ( ) or mysql_fetch_row ( ). If successful, return a display, otherwise return false;

Syntax of mysql_fetch_lengths.

mysql_fetch_lengths(data)
Copy after login
参数.
Copy after login
data:必选就是mysql_query返回的值
Copy after login
来我们来看看实例.
Copy after login
<?
Copy after login
$sql = "SELECT * from Person WHERE Lastname='Refsnes'";
Copy after login
$result = mysql_query($sql,$con);
Copy after login
print_r(mysql_fetch_row($result));
Copy after login
print_r(mysql_fetch_lengths($result));
Copy after login
?>
Copy after login
输出结果.
Copy after login
<pre class="brush:php;toolbar:false">Array
(
[0] => Refsnes
[1] => Kai Jim
[2] => Taugata 2
[3] => 22
)
Copy after login
Array
(
[0] => 7
[1] => 7
[2] => 9
[3] => 2
)
Copy after login

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/630896.htmlTechArticleThe function of mysql_fetch_lengths is to determine mysql_fetch_array (), mysql_fetch_assoc (), mysql_fetch_object () or mysql_fetch_row ( ) length, if Return one if successful...
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template