Support » Plugins » WPDB -class problems

  • risehigher

    (@risehigher)


    Hi,

    at the moment Im writing a plugin which needs database access.
    I tried to use the wpdb-class and have already set $wpdb global.

    Here’s the code:

    <–snip–>
    function foo() {
    global $wpdb;
    $wpdb->query(‘SELECT * FROM table’);
    }
    foo();
    <–snap–>

    This Error returns:
    “Call to a member function query() on a non-object in[..]”

    Thanks in advance.

    .risehigher.

  • The topic ‘WPDB -class problems’ is closed to new replies.