WordPress.org

Forums

Call to a member function query() on a non-object in (2 posts)

  1. mozey
    Member
    Posted 6 years ago #

    in my plugin, i have a method as such:

    function add_ip($datetime, $ip)
    {
    global $wpdb;
    $table_name = $wpdb->prefix . "preclickform_ips";
    $wpdb->query("INSERT INTO " . $table_name . " (datetime, ip) VALUES ('" . $datetime. "','" . $ip . "')");
    }

    AND I GET A FATAL ERROR

  2. mozey
    Member
    Posted 6 years ago #

    it seems that my wpdb is not instantiated properly!. i tried a whole different ways of doing this!, no way!

Topic Closed

This topic has been closed to new replies.

About this Topic