Okay, complete newbie here 🙂 I'm writing a fairly complex script that is going to require connections to the database on every page. I'm completely confused as to how this should be done? One way that I see talked about is:
$mysql_access = mysql_connect($dbhost, $dbuser, $dbpass);
mysql_select_db("databasename", $mysql_access);
And then just do my query
$result = mysql_query("SELECT * from yada_yada");
But--that only applies to that page, no? So won't I have to put that at the beginning of every function/page? Is there no way to just open a connection once, and then do my queries wherever and whenever I want? I looked at mysql_pconnect, but for whatever reason, that didn't work for me...any tips or advice would be appreciated. I'm so lost...