I grab a lot of stuff from my MySQL database on most pages of my site. Is there a better way to go about grabbing this data and making connections to the MySQL database than to include the connection string / code and disconnection strings each time I pull data?
$con = mysql_connect("localhost","toop","poop");
die('Could not connect: ' . mysql_error());
$result = mysql_query('SELECT *...
Or is it better to have a global .php file that always keeps the connection to the database open?