1
kalamata
XOOPS Database
  • 2006/10/27 9:22

  • kalamata

  • Not too shy to talk

  • Posts: 121

  • Since: 2005/3/3 1


Dear All,


When looking at the code of modules, some parts of the code refer to the database as xoopsDB (which I pressume is the one set in incluce/common.php) and other times I see this->$db.

Are they both references to the database? if yes, is one form preferrable to the other? Also, where can I find information about where this->$db is set?

Thanks,
George

2
Mithrandir
Re: XOOPS Database

Yes, they are both references to the same database object.

Usually, when calling the database in a handler class, the database object is referenced in a class variable $db - which is used with $this->db->functionName()

In functions and browser-called files, the $xoopsDB variable is usually used with the similar $xoopsDB->functionName().

$this->db is usually set in the handler class constructor (or its parent's constructor)

For more information on $this->something, please refer to the PHP manual on class variables.
"When you can flatten entire cities at a whim, a tendency towards quiet reflection and seeing-things-from-the-other-fellow's-point-of-view is seldom necessary."

Cusix Software

Login

Who's Online

319 user(s) are online (291 user(s) are browsing Support Forums)


Members: 0


Guests: 319


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits