How to use mysql fetch length in PHP

In this article I am going to explain about mysql_fetch_lengths function in PHP.
  • 2125

PHP mysql_fetch_lengths() Function

The PHP mysql_fetch_lengths function is used to returns the length of each output in a result.

Syntax of mysql_fetch_lengths function

mysql_fetch_lengths(data)

Parameters in mysql_fetch_lengths function

It has only one parameter:

Parameter Description
data It specifies which data pointer to use.

Example of mysql_fetch_lengths function

<html>

<body>

<?php

$con=mysql_connect('localhost','gupta','sharad');

if(!$con)

{

die("Could not connect:".musql_error());

}

$database=mysql_select_db("Mcn_Solution", $con);

$qry="select * from Emp";

$result=mysql_query($qry,$con);

print_r(mysql_fetch_row($result));

echo "<br/>";

print_r(mysql_fetch_lengths($result));

mysql_close($con);

?>

</body>

</html>


Output:

mysql-fetch-lengths-php.jpg

You may also want to read these related articles :
here

Ask Your Question 

Got a programming related question? You may want to post your question here

Programming Answers here

Categories

More Articles

© 2020 DotNetHeaven. All rights reserved.