Forum Moderators: coopster
The problem is I can no longer select my MYSQL database. Consequently the dynamic pages of my web site no longer work.
The way I do it is from a PHP script.
Step 1. Connect to local host by including a php script to make the connection:
include ('../../connect.php')
Step 2. Select the database to work with:
$db1='****'
$db = @mysql_select_db($db1);
if (!$db) { // if value in variable is false (!)
die('Could not select MySQL database, the server returned the error: '.mysql_error());
}
Step 2 is failing with the 'Could not select MYSQL...'error, but always worked until last night. I believe my web server was upgraded by my hosting provider last night
I have discovered that if I cut and paste the lines of code in step 1's connect.php into the same script as the code in Step 2, then I can connect to the MYSQL database ok. Obviously I do not want to use this workaround as it means I would have to paste the connection scipt into a lot of web pages, and this is also less secure as my connection password can be seen more easily
Does anyone know how I fix this problem
Thanks
Peter
08/18/04 4:45:46 PM
==========
error_reporting(E_ALL);Also, you never told us what the mysql error was...?
// Now, if there is a path problem, you'll get an error message here...
include ('../../connect.php')