1

Topic: Punbb's dblayer

Hi there, I'm currently thinking about integrating punbb to an existing website, and I wish to login users against my own tables. I think I know how to do that, however, I have to include common.php.

The issue here is that including common.php will amongts other things define the $db variable to connect to punbb. The problem I have is that I already have a $db variable (my db handler) used to handle all sql queries.

A simple solution would be to define my $db, do my stuff, then include common.php, do the integration stuff and then define my very own $db again. Unfortunately, this is not possible hmm

My question is thus very simple : is my only solution to rename all instances of $db  by $pun_db in punbb's source ?

Thanks in advance,
Eoll

Re: Punbb's dblayer

$my_db = $db;
[punbb stuff]
$db = $my_db;

3

Re: Punbb's dblayer

That was what I was talking about, unfortunately, it's not possible hmm

Re: Punbb's dblayer

Out of curiosity, why not?

5

Re: Punbb's dblayer

Finally I think I'll do it the way the said, by wrapping all the calls inside methods of a dedicated object, I guess it's the best solution smile