db_connect() which connects to my database
Code: Select all
function db_connect()
{
$result = mysql_connect('localhost', 'user', 'password') or exit ("can't connect to database");
if(!$result)
return false;
if(!mysql_select_db('db'))
return false;
return $result;
}Also wondered as I have tens of queries, could all these connections affect perfromance?
thanks in advance