WordPress.org

Ready to get started?Download WordPress

Forums

Form Manager
[resolved] MySQL errors - mysql_fetch_row(): supplied argument is not a valid MySQL result (2 posts)

  1. warrenopus
    Member
    Posted 1 year ago #

    Form Manager Version 1.6.40
    WP version: 3.5.1
    Server: Linux

    On the main 'forms' admin page
    e.g
    /wp-admin/admin.php?page=fm-admin-main

    Submission count column shows this error:
    Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in /wp-content/plugins/wordpress-form-manager/db.php on line 1239

    Last Submission column shows this error:
    Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /wp-content/plugins/wordpress-form-manager/db.php on line 1248

    It appears to be inside
    function getSubmissionDataNumRows($formID){
    $dataTable = $this->getDataTableName($formID);
    $q = "SELECT COUNT(*) FROM {$dataTable}";
    $res = $this->query($q);
    $row = mysql_fetch_row($res);
    mysql_free_result($res);
    return $row[0];
    }

    http://wordpress.org/extend/plugins/wordpress-form-manager/

  2. warrenopus
    Member
    Posted 1 year ago #

    RESOLVED.

    I used WSD security to rename the database table prefixes. So they would not be wp_%tablename%, the wp_ is replaced. All plugins work fine with this but not WordPress Form Manager.

    WordPress Form Manager stores it's table name inside the database!

    mysql> SELECT data_table FROM wp_fm_forms WHERE ID = '1'
    -> ;
    +--------------+
    | data_table |
    +--------------+
    | wp_fm_data_1 |
    +--------------+

    The data_table value is hardset in the DB to wp_fm_data_1
    When you utilize WSD security to alter your table prefix this is what happens, the datatable name is now set to %newprefix%_fm_data_1
    but the table name stored in the DB is still wp_fm_data_1 not %newprefix%_fm_data_1

    Use a mysql update statement
    update %newprefix%_fm_forms set data_table = '%newprefix%_fm_data_1' where ID = '1';

    update %newprefix%_fm_forms set data_table = '%newprefix%_fm_data_1' where ID = '2';

    etc...

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic