I have a website where at the top of each page I include a page that opens a mysql_connect connection, so I don't have to open up the connection each time I need to modify or insert stuff into the database. Is this safe, or should I open and close each connection once I'm done using it?
require_once("../include/mysqlconn.php");
$sql = "SELECT * FROM blah";
$query = mysql_query($sql);