WordPress.org

Forums

mysql_num_rows(): error in wp-optimize-admin.php (9 posts)

  1. Chris
    Member
    Posted 5 years ago #

    error message in Database Tables Report:
    mysql_num_rows(): supplied argument is not a valid MySQL result resource in ... /wp-content/plugins/wp-optimize/wp-optimize-admin.php on line 343
    This seems to be a general problem appearing sometimes in MySQL when you have a dash in the the database name. I solved it by changing line 341 in that wp-optimize-admin.php to

    $local_query = 'SHOW TABLE STATUS FROM '. DB_NAME .';

    (i.e. by adding "backticks" before and after DB_NAME. I hope they won't convert here to markup.)

    http://wordpress.org/extend/plugins/wp-optimize/

  2. Chris
    Member
    Posted 5 years ago #

    Well, seems it doesn't display correctly. So you need to add one backtick before '. and a second one after .'

  3. Dennis
    Member
    Posted 4 years ago #

    for me this solution didn't work, still the same problem :S

  4. nowton
    Member
    Posted 4 years ago #

    anyone mind pasting the correct code?

  5. Dennis
    Member
    Posted 4 years ago #

    To fix my problem I change to this:

    $local_query = 'SHOW TABLE STATUS FROM'.DB_NAME.'';

  6. nowton
    Member
    Posted 4 years ago #

    didn't work over here. Reporting this one broken.

  7. Dennis
    Member
    Posted 4 years ago #

    Sad. I really don't know anything else to do.

  8. zeaks
    Member
    Posted 4 years ago #

    Yeah I'm getting the same problem, it's been working great for a long time, this is a recent error.

    I'm also getting
    Warning: mysql_query() [function.mysql-query]: Access denied for user 'my-database'@'localhost' (using password: NO) in /home/mysite/public_html/wp-content/plugins/wp-optimize/wp-optimize-admin.php on line 342

  9. ruhanirabin
    Member
    Posted 4 years ago #

    Upgraded the plugin and fixed some codes. Please do check the upgraded version and let me know.

    • Added auto draft post removal feature
    • Fixed problem with database names containing "-"
    • NEW Main Level Menu Item added for WP-Optimize, You might need to scroll down to see it
    • Compatibilty with wordpress 3.1
    • Upgraded translation pot file

Topic Closed

This topic has been closed to new replies.

About this Topic