WordPress.org

Ready to get started?Download WordPress

Forums

Nextend Twitter Connect
[resolved] Fatal Error: Call to undefined function dbDelta() (8 posts)

  1. playvue
    Member
    Posted 1 year ago #

    Received the following Fatal Error when attempting to activate v 1.4.60 of this plugin.

    Fatal error: Call to undefined function dbDelta() in /var/www/[mywebsite]/wp-content/plugins/nextend-twitter-connect/nextend-twitter-connect.php on line 76

    I am running WP on sqlite3, but as that's not an UNcommon situation, figured I'd still post it here.

    http://wordpress.org/extend/plugins/nextend-twitter-connect/

  2. playvue
    Member
    Posted 1 year ago #

    This issue seems to be a common one when using alternative databases. For me, it was resolved by this:

    Find dbDelta($sql); in plugin file “index.php” and replace it with

    //dbDelta($sql);
    $wpdb->query($sql);

    The solution was found here: http://html5.svnlabs.com/faqs/fatal-error-call-to-undefined-function-dbdelta-in-wp-contentpluginshtml5-video-player-with-playlistindex-php-on-line-211/

    An alternative option is to try:

    //dbDelta($sql);
    mysql_query($sql);

  3. WebTechGlobal
    Member
    Posted 6 months ago #

    dbDelta() does not just execute a CREATE query. It also updates existing tables.

    I found this post as I've started to get the same issue in WP e-Customers. dbDelta() is called within a class method which is used in the method that the activation hook calls.

    I made changes. I moved dbDelta() for about six tables into a create_tables() function. Previously they sat in the function called directly by the activation hook. I'll be surprised if it is the cause but it is the only change I made.

  4. WebTechGlobal
    Member
    Posted 6 months ago #

    This is required. I've just forgotten to move it with everything else. Actually whenever your working in a plugin and you get a function undefined error. It usually because the plugin needs to include it.

    require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );

  5. teclive
    Member
    Posted 4 months ago #

    Hi everyone, hope we are all doing well.
    I have been working on a site, and upon trying to activate a plugin, I was faced with this error

    error: Call to undefined function dbDelta() in xxxxxxxxxxxxx/wp-content/plugins/purple-xmls/purple-xmls-setup.php on line 16

    I was wondering if anybody knew the best way to resolve this issue.

    thank you kindly for your time
    Tanya

  6. WebTechGlobal
    Member
    Posted 4 months ago #

    Try adding this...

    require( ABSPATH . 'wp-admin/includes/upgrade.php' );

  7. teclive
    Member
    Posted 4 months ago #

    Thank you kindly my friend. Which file would I be applying the change to?

  8. WebTechGlobal
    Member
    Posted 4 months ago #

    You can add the line anywhere before the dbDelta() function. I'd be surprised if the error is WordPress core itself, probably a plugin. However if there is a missing file or customizing to the core it is possible.

    The dbDelta() function creates database tables. If a plugin is attempting to create a table you need to either place that line somewhere in the plugins files or disable the plugin until it is fixed.

    If you cannot access your blog at all. Use FTP to access the wp-content/plugins directory and delete all plugins. Remembering to back em all up first.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic