Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Michael Simpson

    (@msimpson)

    What version of WP are you running? Is is pre-3.1.0?

    Thread Starter Claudio Sanches

    (@claudiosanches)

    WordPress 3.2.1 and Contact Form 7 to Database Extension 2.2.1.

    Plugin Author Michael Simpson

    (@msimpson)

    Would you try this: Edit the plugin file CFDBQueryResultIterator.php

    Find this code starting line 116

    // Target charset is in wp-config.php DB_CHARSET
            if (defined('DB_CHARSET') && 'DB_CHARSET' != '') {
                global $wpdb;
                $wpdb->set_charset($con,
                                   DB_CHARSET,
                                   (defined('DB_COLLATE') && 'DB_COLLATE' != '') ? DB_COLLATE : null);

    Replace with:

    // Target charset is in wp-config.php DB_CHARSET
            if (defined('DB_CHARSET')) {
                if (DB_CHARSET != '') {
                    global $wpdb;
                    if (method_exists($wpdb, 'set_charset')) {
                        $collate = null;
                        if (defined('DB_COLLATE')) {
                            if (DB_COLLATE != '') {
                                $collate = DB_COLLATE;
                            }
                        }
                        $wpdb->set_charset($con, DB_CHARSET, $collate);
                    }
                    else {
                        $setCharset = 'SET NAMES \'' . DB_CHARSET . '\'';
                        if (defined('DB_COLLATE')) {
                            if (DB_COLLATE != '') {
                                $setCharset = $setCharset . ' COLLATE \'' . DB_COLLATE . '\'';
                            }
                        }
                        mysql_query($setCharset, $con);
                    }
                }
    Thread Starter Claudio Sanches

    (@claudiosanches)

    it works, thank you.

    Plugin Author Michael Simpson

    (@msimpson)

    Great. I’ll push out that change in an update so everyone gets it.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘[Plugin: Contact Form 7 to Database Extension] Fatal error: Call to undefined method dbrc_wpdb::set_’ is closed to new replies.