say i have:
$dbconnection = mysql_connect($dbhost,$dbuser,$dbpass) or die ('Unable to connect to database');
mysql_select_db('db') or die('Unable to select database');
/*
some other functions....
*/
if($_POST['submit'] && !$_POST['search'])
{
mysql_query("INSERT INTO ...");
}
How do i access the database connection without repeating the mysql connection function more than once? I tried using global $dbconnection; but it still wont let me use that connection..
i'm trying to aviod making custom connect class functions.