This topic seems a bit dated but I will reply none the less.
If you connect outside of the query function, where you only connect the one time, what is the disadvantage of using mySQL over PEAR. (Besides not having the easy migration capabilites)
For example:
// In your page
$dbname = 'sample_db';
$hostname = 'localhost';
$username = 'test';
$password = 'test';
$id_link = @mysql_connect($hostname,
$username, $password);
DBCommand('select * from foo');
// do whatever with result and disconnect.
Is there a problem with this methodology?