How to use the database in a userdefinded tag ?

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Locked
mp17

How to use the database in a userdefinded tag ?

Post by mp17 »

Hi
I want to use the database in  a userdefined tag, for example something like that:
$db->Execute("");

The compiler says, that $db ist not an object. So, I have to do sth like that:

global $db ...

But that doesnt work, does somebody know hox to solve that problem ?

mfg, mp17 :)
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm

Re: How to use the database in a userdefinded tag ?

Post by calguy1000 »

try:

Code: Select all

global $gCms;
$db =& $gCms->GetDb();
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
Locked

Return to “CMSMS Core”