Forum Moderators: coopster
just want to ask..
is it important to close your query and unset() you unused variables and sessions?
for example i query my users... do i really have to end it...
<?php
inlcude("dbConnect.php");
$result = mysql_query("select * from users where id = 1");
$exist = mysql_num_rows($result);
if ($exist)
{
echo "OK";
} else {
echo "ERR";
}
mysql_close(); // --> is it important to always close the query?
unset($exist); // --> and unset the unused variables?
mysql_free_result($result); // --> and must free the results?
?>
coz i was used not to close this things.. if their any effect? or negative effect of something?
Using mysql_close() isn't usually necessary, as non-persistent open links are automatically closed at the end of the script's execution. See also freeing resources [php.net].