ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

PHP and MySQL problems

August 14, 2014 10:19pm

Subscribe [2]
  • #1 / Aug 14, 2014 10:19pm

    dagga

    15 posts

    I recently upgraded to EE 2.x. We use custom PHP to pull in additional Tables from MySQL. For some reason in the new version (came from version 1.7), any PHP code we add throws an error such as this:

    {!-- ra:000000001f173b7d0000000097627d64 --}
    Fatal error: Call to a member function query() on a non-object in /home/xxxx/public_html/system/expressionengine/libraries/Functions.php(688) : eval()‘d code on line 19

    I’ve even tested this with a simple query such as this:

    <?php
    global $DB;
    $data = $DB->query(“SELECT * FROM `exp_channels` WHERE `channel_name` LIKE ‘connect’”);
    ?>

    I do have PHP enable for the Template and have never had any issues with this until the new 2.x install. We use this a lot to pull in additional data from tables we import outside of EE.

    Any ideas? Thanks!

  • #2 / Aug 19, 2014 12:59pm

    dagga

    15 posts

    Any Ideas? This seems like it would be pretty simple.. I simply need to call data (using the same database) from a table outside of EE. Every query gives me that strange error code, so i’m thinking it’s a plugin or something.

  • #3 / Aug 26, 2014 12:14am

    Supply

    18 posts

    I’m having the same issue. Did you end up finding a fix?

  • #4 / Aug 26, 2014 12:20am

    Supply

    18 posts

    ... actaully it seems it happens when you call die(); not so much an sql query.

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases