it is a very long time I was here (2006?) but I hope you can help me.
When the switch to phpbb3 happened I decided to stay with my customized version of phpBB 2.0.23 with the Solaris template (you can see it here: https://www.spearhead-home.com/phpBB2/). It is still working fine for me (Using it as an archive) and it is still running with PHP Version 5.6.40 and MySQL 5.7.
Now I want to use the newest version of PHP 7.3.7 and got the problems with the deprecated mysql_connection and depended functions. For my other tables outside phpbb2 I use already the PDO functions.
Is it possible to rewrite the sql_db class to use PDO something like this:
Code: Select all
class sql_db
{
var $db_connect_id;
var $query_result;
var $row = array();
var $rowset = array();
var $num_queries = 0;
var $in_transaction = 0;
function sql_db($sqlserver, $database, $sqluser, $sqlpassword)
{
$this->db_connect_id = 0;
$this->server = $sqlserver;
$this->dbname = $database;
$this->user = $sqluser;
$this->password = $sqlpassword;
$this->$options = array( PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8');
try
{
$this->db_connect_id = new PDO("mysql:host=".$this->server.";dbname=".$this->dbname, $this->user, $this->password, $options);
}
catch (PDOException $e)
{
print "Error!: " . $e->getMessage() . "<br/>";
}
return $this->db_connect_id;
}
//...
//Same changes to
//mysql_query
//mysql_num_rows
//mysql_affected_rows
//mysql_fetch_array
//should be made
}
Thanks Joerg