(PHP 4, PHP 5)
mysql_free_result — 锟酵放斤拷锟斤拷诖锟�
$result
) : bool
mysql_free_result() 锟斤拷锟酵凤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷识锟斤拷
result
锟斤拷锟斤拷锟斤拷锟斤拷锟节存。
mysql_free_result() 锟斤拷锟斤拷要锟节匡拷锟角碉拷锟斤拷锟截很达拷慕锟斤拷锟斤拷时锟斤拷占锟矫讹拷锟斤拷锟节达拷时锟斤拷锟矫★拷锟节脚憋拷锟斤拷锟斤拷锟斤拷锟斤拷锟叫癸拷锟斤拷锟斤拷锟节存都锟结被锟皆讹拷锟酵放★拷
锟缴癸拷时锟斤拷锟斤拷 TRUE
锟斤拷 锟斤拷锟斤拷锟斤拷失锟斤拷时锟斤拷锟斤拷 FALSE
锟斤拷
为锟斤拷锟铰硷拷锟斤拷锟斤拷然锟斤拷锟斤拷使锟斤拷 mysql_freeresult()锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷
锟缴癸拷时锟斤拷锟斤拷 TRUE
锟斤拷 锟斤拷锟斤拷锟斤拷失锟斤拷时锟斤拷锟斤拷 FALSE
锟斤拷
If a non-resource is used for the result
, an
error of level E_WARNING will be emitted. It's worth noting that
mysql_query() only returns a resource
for SELECT, SHOW, EXPLAIN, and DESCRIBE queries.
Example #1 A mysql_free_result() example
<?php
$result = mysql_query("SELECT id,email FROM people WHERE id = '42'");
if (!$result) {
echo 'Could not run query: ' . mysql_error();
exit;
}
/* Use the result, assuming we're done with it afterwards */
$row = mysql_fetch_assoc($result);
/* Now we free up the result and continue on with our script */
mysql_free_result($result);
echo $row['id'];
echo $row['email'];
?>
Note:
为锟斤拷锟斤拷锟铰硷拷锟捷o拷锟斤拷锟斤拷使锟斤拷锟斤拷锟斤拷锟窖凤拷锟斤拷锟侥憋拷锟斤拷锟斤拷 mysql_freeresult()