• Since the latest update to WordPress, my plugin will no longer allow me to get the info from a custom db table – keeps telling me “Access denied for user … (Using password: NO)”.

    Nothing has changed with the plugin and I can’t find where anything relevant has changed with WP!

    I tried deactivating the plugin and then reactivating – no problems when doing that but no good result either (thought WP might show me any errors in my code due to the update).

    I know it’s pretty general, but can anyone think of any recent changes that could trigger this issue?

Viewing 2 replies - 1 through 2 (of 2 total)
  • maria

    (@mariarobinson)

    Just as a check, try deactivating all plugins bar the one that you’ve already tried. If that resolves the issue, reactivate each one individually until you find the cause. You could also try changing the theme to a default one. Just to see if that solves the issue.

    Thread Starter Statsman

    (@statsman)

    Thanks for the reply.

    Think I’ve narrowed the issue down to me using mysql_query instead of $wpdb. I’ve eliminated that particular error but am now having issues with not getting any results from my query.

    This works without error:

    function get_leagues( ) {
    // Returns leagues information for network admin page
    global $wpdb ;
    $leagues_db_table = $wpdb->spc_leagues ;
    if ( is_wp_error( $leagues_db_table ) ) {
    $leaguesQuery = $leagues_db_table->get_error_message() ;
    } else {
    $queryStr = “SELECT * FROM $leagues_db_table” ;
    $leagues = $wpdb->get_results( $queryStr ) ;
    if ( $leagues != null ) {
    return $leagues ;
    } else {
    return new WP_Error( ‘Leagues Database Error’, … ) ;
    }
    }
    }

    But then when I go to use the result I get “No leagues found” and it generates an error: Warning: mysql_fetch_array() expects parameter 1 to be resource, array given in /home/ … spc-leagues.php on line 316.

    Is there an equivalent to the mysql function that I should be using since it was the original mysql query that broke my site?

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Access denied’ is closed to new replies.