UseBB Community

The official board for UseBB help and discussion

UseBB Community » Help & Support » Problem with phpBB convertor

Problem with phpBB convertor

Moderators: Gaia.

Page: 1

Author Post
Member
Registered: Jul 2006
Posts: 18
Hello,

I tried the phpBB convertor with this configuration : UseBB's tables were on 'usebb' databse and phpBB were on 'phpbb' database.

I'm sure of my convertor's configuration. But there is a mysql error : the script don't found phpBB's tables.

I think there is a problem in the SQL class : It can't work with this code because you select the database (@mysql_select_db) in the function 'connect'. So this kind of script can't work :
... Inclusion of db_mysql.php
$first_db = new db;
$first_db->connect(blablabla....);

$second_db = new db;
$second_db->connect(blablabla2....); // with a different database than fist_db

$first_db->query(blablabla); // here we will obtain an error. The query will be executed on the databse of the second db, because the last selected database was the second db.


So 'I think' that the db class does not allow to work on two different database at the same time.

I explain really badly in English, but do you see what I mean ?

Cordially.
_______________
French Webmaster of InformatiqueFrance.com
Member
Registered: Apr 2006
Posts: 57
Location: Athens, Greece
As far as I know, the phpBB converter cannot work with multiple db's. UseBB's db and phpBB's as well must be the same.
Member
Registered: Jul 2006
Posts: 18
So during the configuration of the convertor, why do the script ask the phpBB database configuration ?
_______________
French Webmaster of InformatiqueFrance.com
Developer
Registered: Apr 2004
Posts: 2224
Location: Belgium
I have tested the convertor with a separate MySQL username, password and database name and it works. The db class uses a $connection property to store the connection, which is used for every mysql_query() statement.

I don't know why it doesn't work with you. Did you use the right table prefix?
_______________
--Dietrich (developer)
UseBB roadmap, dev mailing list & weblog
Member
Registered: Jul 2006
Posts: 18
I really don't understand. I do a new test, and I always obtain the same result. I am absolutely certain of my phpBB convertor's configuration.

The error is :
Quote
Fatal error: SQL: Count “phpbb.usebb_badwords” doesn' T exist in c:\program files\easyphp\www\test _usebb \ usebb \ sources \ db_mysql.php one line 114

Before :
Quote
Creating database connections...
Emptying existing tables...

then the error.

I don't understand how to make working this converter… To tell the truth, I don't understand how to use the MySQL driver with two different data bases.

(I want to add that I made tests on a local serveur, but also on the serveur of my website)
_______________
French Webmaster of InformatiqueFrance.com
Member
Registered: Jul 2006
Posts: 18
To find the problem, I tried to modify db_mysql.php. A very small modification of the position of the mysql_select_db (); allows the convertor to work normally.

The modification :
- Line 71, add :
Quote
var $db_name;

- Line 92 replace
Quote
@mysql_select_db($config['dbname'], $this->connection) or trigger_error('SQL: '.mysql_error($this->connection), E_USER_ERROR);

by
Quote
$this->db_name = $config['dbname'];

- Line 106, add :
Quote
@mysql_select_db($this->db_name, $this->connection) or trigger_error('SQL: '.mysql_error($this->connection), E_USER_ERROR);


Why do you think of this ? :?

Sorry for the double post :oops:
_______________
French Webmaster of InformatiqueFrance.com
Developer
Registered: Apr 2004
Posts: 2224
Location: Belgium
I will test this tomorrow.
_______________
--Dietrich (developer)
UseBB roadmap, dev mailing list & weblog
Developer
Registered: Apr 2004
Posts: 2224
Location: Belgium
The problem was, when creating multiple connections with the same host, username and password, PHP does not create a new connection. Since this was the case here, and the last DB selected is phpBB's, you get these kinds of errors.

The fix is to pass true as the value for the new_link parameter in mysql_connect(). This has been fixed in UseBB-CVS.
_______________
--Dietrich (developer)
UseBB roadmap, dev mailing list & weblog
Member
Registered: Jul 2006
Posts: 18
Ok Dietrich, I got the truth now !

I will be able to continue my project of convertor for Invision now.
_______________
French Webmaster of InformatiqueFrance.com

Page: 1

UseBB Community » Help & Support » Problem with phpBB convertor

UseBB Community is powered by UseBB 1 Forum Software