Database Function connectGlobalDB()

function connectGlobalDB()

Name in Zenario 8

ze\db::connectGlobal()

Summary

Connects to the global database, so you may query any global tables.

Where You Can Use It

From Zenario 7.0.0 onwards.

Description

When you connect to a database using a function such as connectGlobalDB(), connectHubDB() or connectLocalDB() the database functions will then run queries against that database.

You must call this function before you query a table in the global database, and you must then call connectLocalDB() before querying any local table or calling any of the CMS functions.

Return Value

If the connection parameters for the global database are not defined then this function will do nothing and return false.

If the parameters were defined but the connection did not succeed then this function will generate a database error and then exit.

If the global database is defined and is working then this function will make the connection then return true.

Notes

As of version 7.0.2 we are now using MySQLi. You can now access the global database using the cms_core::$globalDB variable and access the last database that was connected to using the cms_core::$lastDB variable. The database functions will always run queries using the cms_core::$lastDB variable.