Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.

  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

18.2. Functions > mysql_free_result

Name

mysql_free_result

Synopsis

boolean mysql_free_result(qresource query)

Frees all memory used by a query resource handle. This occurs automatically at the end of a script, but this function may be useful in scripts where repeated querying is performed or memory is constrained.

The function returns true on success and false on error.

Example

<?php
  $query = "SELECT * FROM presents";
  
  $connection = mysql_connect("localhost", "fred", "shhh");
  mysql_select_db("wedding", $connection);
  
  $result = mysql_query($query, $connection);
  
  while ($row = mysql_fetch_object($result, MYSQL_ASSOC))
  {
     echo "\n\nQuantity:\t" . $row->quantity;
     echo "\nPresent:\t" . $row->present;
     echo "\nShop:\t" . $row->shop;
  }
  
  mysql_free_result($result);
?>

  

You are currently reading a PREVIEW of this book.

                                                                                                                    

Get instant access to over $1 million worth of books and videos.

  

Start a Free 10-Day Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint