Support ⇒ Modules & Blocks ⇒ Porting over a database function ⇒ Community Forums ⇒ CPG Dragonfly™ CMS
Forum IndexModules & Blocks

Porting over a database function Reply to topic


Hello all it's been a while:)

I am trying to port a script and it has this for the db connection.

function GetGlobalConnectionOptions()
{

return array(
'server' => 'localhost',
'port' => '3306',
'username' => 'xxxx',
'password' => 'xxxx',
'database' => 'xxxx'
);


I have tried 50 goofy ways to rewrite this but still come up empty with access to DF $db abstraction object.

Here is my latest rendition where I am not getting any error messages but clearly not getting the results.


function GetGlobalConnectionOptions()
{

global $db;
$db = array();
return $db;
}

Any help on this will be greatly appreciated.

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
linux,apache,5.0.11.,5.6.30,9.3.4.1


If you are porting a script you should make the script use DragonflyCMS database abstraction layer, $db. This way you won't have two active connections but only one.

.:: I met php the 03 December 2003 :: Unforgettable day! ::.

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
CloudLinux / Apache 2.4 LSAPI / MySQLi 5.6 / PHP 5.6 / DCVS

All times are UTC


Jump to: