Hello,
I'm a PHP/SQL newbie developing a MySQL db using PHP on a UNIX box
running Apache.
I have notice in a lot of tutorials, PHP code ends with:
mysql_free_result($sql_result);
mysql_close($connection);
?>
Is it crucial to include this at the end of every PHP file that opens a
db connection and has a SQL statement? What if it isn't included?
I have tried inserting this code in files that include more than one sql_result and I get an error if I include a version for each result (mysql_free_result($sql_result1);mysql_free_result($sql_result2);mysql_free_result($sql_result3);mysql_free_result($sql_result4); ... etc.
Thanks for the help!
Nick
I'm a PHP/SQL newbie developing a MySQL db using PHP on a UNIX box
running Apache.
I have notice in a lot of tutorials, PHP code ends with:
mysql_free_result($sql_result);
mysql_close($connection);
?>
Is it crucial to include this at the end of every PHP file that opens a
db connection and has a SQL statement? What if it isn't included?
I have tried inserting this code in files that include more than one sql_result and I get an error if I include a version for each result (mysql_free_result($sql_result1);mysql_free_result($sql_result2);mysql_free_result($sql_result3);mysql_free_result($sql_result4); ... etc.
Thanks for the help!
Nick