2 blueyed Jan 10, 2007 22:31

Hey blueyed, what is the point of using a & on the line;
$DB = & new DB( $temp_db_config );
php4 legacy to use a reference to the created object not a copy. In PHP5, the "&" is implied (always a reference).
Just as an aside, would it not be better to do $temp_DB = & new DB( $temp_config ); so there's no chance of "forgetting" to reconnect to the normal db?
¥
Yes, it's probably the best practise to use $temp_DB also and leaving the original $DB object alone.
However, this depends on "//do whatever html is necessary here" - there might be a function which uses the $DB global, but that's unlikely.
In any case, the original $DB should get saved (and restored later), instead of reconnecting again.
You're missing the $db_config settings from /conf/_advanced.php.
Just do it like this: