I'm coming over from ASP so bear with me.
I like to do programming as tight and resource-minimal as possible, and know from ASP you need to close a database connection as soon as possible. I'm sure that goes with PHP as well.
How soon after I use mysql_connect($hostname, $username, $password); can I safely close the connection? Usually a)choose the databse through mysql_select_db, then b) use mysql_query() to perform an operation then c)$mysql_fetch_array to get a row of data.
I've found that putting mysql_close() as high as RIGHT AFTER the mysql_connect() command has no effect on my output (I still successfully get my data). Therefore I don't really understand mysql_close because I would think it would close the resource out and the query would no longer be possible.
Anyone have some insight into what PHP is thinking here? Again, this is to write as tight a code as possible.
Sam Fullman
Compass Point Media