Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author cpres

    (@cpres)

    oh crap. thanks for this. Looks like mysql-list-fields is deprecated so we’ve officially lost WordPress support for using it within the plugin.

    https://php.net/manual/en/function.mysql-list-fields.php

    Thanks for finding this! working on the fix now!

    Plugin Author cpres

    (@cpres)

    Update the get_fields function to this:

    function get_fields($table = null) {
            global $wpdb;
    
            if (!empty($table)) {
                $fullname = $table;
    
                if (($tablefields = $wpdb->get_results( 'SHOW COLUMNS FROM '.$table, OBJECT )) !== false) {
                    $columns = count($tablefields);
                    $field_array = array();
                    for ($i = 0; $i < $columns; $i++) {
                        $fieldname = $tablefields[$i]->Field;
                        $field_array[] = $fieldname;
                    }
    
                    return $field_array;
                }
            }
            return false;
        }
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘mysql_num_fields and mysql_list_fields’ is closed to new replies.