Results 1 to 2 of 2

Thread: database access from dca\tl_module.php possible?

  1. #1
    New user
    Join Date
    09-03-09.
    Posts
    15

    Default database access from dca\tl_module.php possible?

    when i try to access the database using
    Code:
    $q1 = $this->Database->prepare($sql)->execute();
    it ends in an error
    Fatal error: Using $this when not in object context in C:\...\mymodule\dca\tl_module.php on line 67

  2. #2
    User
    Join Date
    08-07-09.
    Location
    Kent, United Kingdom
    Posts
    92

    Default Re: database access from dca\tl_module.php possible?

    The DCA files are mostly configuration files, they cannot have executable PHP code within them since an object reference such as $this will have no context.

    Instead you can create class files within the file ( ie class myclass extends Backend{}) and then use the various callback arguments to call the relevant class.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •