1 rivka Jan 10, 2007 01:53
3 balupton Jan 10, 2007 23:46
Hey blueyed, what is the point of using a & on the line;
$DB = & new DB( $temp_db_config );
4 blueyed Jan 11, 2007 01:24
php4 legacy to use a reference to the created object not a copy. In PHP5, the "&" is implied (always a reference).
5 yabba Jan 11, 2007 02:14
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?
¥
6 blueyed Jan 11, 2007 02:33
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: