Just to clearfy: the purpose of this is to minimize to it's fullest mysql connection time. It's inspired by how the honda hybrid electric cars work: when it's at a complete stop, the engine just shuts off, saving gas.
so here's an example: registration page:
verify if first page was inputted, cool..
verify if last page inputted, cool..
verify username is inputted, cool.
check if username is already in use:
> connect to mysql at this point.
check it, return result
> close mysql now
verify if phone number is ok, cool
verify if birthdate is ok, cool.
verify if email addy has been inserted,cool
check to see if another email has been used
> connect to database
return result
> close database
very all other fields ok, cool.
if cool, insert data into database:
> connect to database, insert info
no need to do another mysql_close() at this point, it's the end of the script in this example..
Smart? or thinkin too hard? or what?