How to use mysql free result in PHP

In this article I am going to explain about mysql_free_result function in PHP.
  • 1864

PHP mysql_free_result() Function

The PHP mysql_free_result function is used to returns free result memory. The mysql_free_result function returns true on success, or false on failure.

Syntax of mysql_free_result function

mysql_free_result(data)

Parameters in mysql_free_result function

It has only one parameter:

Parameter Description
data It specifies which result handle to free.

Example of mysql_free_result function

<?php

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

if(!$con)

{

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

}

mysql_select_db("Mcn_Solution",$con);

$result = mysql_query("select * from emp");

$row = mysql_fetch_assoc($result);

mysql_free_result($result);

echo $row['Fname'];

echo " ";

echo $row['LastName'];

echo " ";

echo $row['Id'];

?>


Output:

mysql-free-result-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.