What is mysql field len in PHP

In this article I am going to explain about mysql_field_len function in PHP.
  • 1759

PHP mysql_field_len() Function

The PHP mysql_field_len function is used to returns length of specified field.

Syntax of mysql_field_len function

mysql_field_len(data, fieldOffset)

Parameters in mysql_field_len function

It have two parameter:

Parameter Description
data It specifies which data pointer to use.
fieldOffset It specifies which field to start returning.

Example of mysql_field_len function

<?php

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

if(!$con)

{

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

}

mysql_select_db("Mcn_Solution",$con);

$res=mysql_query("Select * from Emp");

$length=mysql_field_len($res,0);

echo "The length is:".$length;

mysql_close($con);

?>


Output:

mysql-field-len-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.