Results 1 to 4 of 4
Thread: Best Connection practices?
Apr 4, 2007, 10:57 #1
- Join Date
- Apr 2007
- 0 Post(s)
- 0 Thread(s)
Best Connection practices?
I have a very busy gaming website that is fully database driven. The site receives upto 15k uniques a day and 60 million page views per month.
Currently, each new page is included into the main index.php file. The connection to the database is achieved via the following in the index.php:
$dbserver = "localhost"; $dbuser = "userhere"; $dbpass = "passhere"; $db = "dbnamehere"; mysql_connect($dbserver, $dbuser, $dbpass); mysql_select_db($db);
User visits site which loads index.php. User then goes to the games page which includes games.php into the index.php file in the appropriate place. So index.php is thus loaded twice. Once with the standard data and then once with the new included file.
There is no code anywhere in any script that close the db connection.
So my question to you is - is there a problem with this setup? And if so, what would be the best way to do this.