Support » Plugins » mysql_num_rows(): error in wp-optimize-admin.php

  • 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.)

Viewing 8 replies - 1 through 8 (of 8 total)
  • Well, seems it doesn’t display correctly. So you need to add one backtick before ‘. and a second one after .’

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

    anyone mind pasting the correct code?

    To fix my problem I change to this:

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

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

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

    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

    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
Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘mysql_num_rows(): error in wp-optimize-admin.php’ is closed to new replies.