Hi,
This has been bothering me for a while, I get contradictory info whenever I search for it. Is it required to use mysql_close() when using mysql_connect()? Advantage of using it vs. not using it?
Hi,
This has been bothering me for a while, I get contradictory info whenever I search for it. Is it required to use mysql_close() when using mysql_connect()? Advantage of using it vs. not using it?
I don’t know that its strictly required in most cases, but generally its considered a wise idea to free up resources when you’re done using them. Also, some shared hosting accounts may have a limit of how many db connections you have open at one time - closing the connection when done avoids running up against this.
You don’t have to close the database connection – when the page is done parsing, it will close automatically.
I would try to learn the mysqli functions (notice the “i” for improved) (It’s a fresher update of mysql functions). If you are a little more advanced you should checkout PDO, it’s very good, but it is scary at first!
Use PDO. Then you don’t have to worry about closing the connection because the PDO class will do it for you.
hmm… I’ll check it out.
JREAM, no I’m not at all advanced - so I’ll stay away from PDO for now.