First up, I upgraded from php 4.1 to php 5. I'm running apache. 1.3 I think.
Anyway, it's probably something stupid I've done and not the php and apache versions but I don't know.
Here's the problem code.
class DB_sql
{
var $dbname;
var $servername;
var $dbusername;
var $dbpassword;
function DB_sql($dbname, $servername, $dbusername, $dbpassword) {
$this->dbname = $dbname;
$this->servername = $servername;
$this->dbusername = $dbusername;
$this->dbpassword = $dbpassword;
}
//You'll never believe what this does
function connect()
{
// global $dbname, $servername, $dbusername, $dbpassword;
//connect to database
$this->id_link = @mysql_connect($this->servername, $this->dbusername,
$this->dbpassword);
//check connection
if (!$this->id_link) {
$this->stop('Failed to connect to Mysql Database');
}
//pick database
if (!mysql_select_db($this->dbname, $this->id_link))
{$this->stop('DBconnection failed');
}
}
okay, that's the class. Anyway, when I run $DB->connect(); it starts running the class it gets to:
//connect to database
$this->id_link = @mysql_connect($this->servername, $this->dbusername,
$this->dbpassword);
and dies.
I ran echoes between each line of code to see where the script stops working. It's directly after this line. I checked all the $this->* vars in the connection and they all have the correct values. The only thing I done was update the php and add gd library.
Anybody see what could cause this problem?
Thanks.