The MU forums have moved to WordPress.org

Database Error in WPMU Admin (5 posts)

  1. schun
    Member
    Posted 17 years ago #

    I am getting following db error messages when I click on the following column link-

    1) Site Admin > Blogs (wp-admin/wpmu-blogs.php)
    > Click 'Users' column link

    "WordPress database error: [You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ASC LIMIT 0, 60' at line 3]
    SELECT * FROM wp_blogs WHERE site_id = '1' ASC LIMIT 0, 60"

    > Click 'Actions'
    WordPress database error: [You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ASC LIMIT 0, 60' at line 3]
    SELECT * FROM wp_blogs WHERE site_id = '1' ASC LIMIT 0, 60

    2) Site Admin > Users (wp-admin/wpmu-users.php)
    > Click 'Registered'
    WordPress database error: [Unknown column 'registered' in 'order clause']
    SELECT * FROM wp_users ORDER BY registered ASC LIMIT 0, 30

    I just downloaded WPMU 1.0 and fresh installed.

    Any advice would be appreciated. Thanks!

  2. andrea_r
    Moderator
    Posted 17 years ago #

    Has anyone submitted this to trac? It's def. a bug.

  3. schun
    Member
    Posted 17 years ago #

    I guess you are having the same issue?
    Anyone know how to fix this?

    Thanks!

  4. schun
    Member
    Posted 17 years ago #

    Just for information..

    I have modified the following files to fix these issue:
    1) wp-admin/wpmu-blogs.php
    - updated line #389 ~

    <?php foreach($posts_columns as $column_display_name) { ?>
    <th scope="col"><?php if ($column_display_name == 'Users' ) { echo "Users"; }
    else if ($column_display_name == 'Actions' ){ echo "Actions"; }
    else { ?>&sortby=<?php echo urlencode( $column_display_name ) ?>&<?php if( $_GET[ 'sortby' ] == $column_display_name ) { if( $_GET[ 'order' ] == 'DESC' ) { echo "order=ASC&" ; } else { echo "order=DESC&"; } } ?>start=<?php echo $start ?>"><?php echo $column_display_name; ?></th> <?php } ?>
    <?php } ?>

    2) wp-admin/wpmu-users.php
    - Line # 147

    Change $query .= ' ORDER BY registered ';
    To $query .= ' ORDER BY user_registered ';

    Probably there are better way to fix (1) but this solution elimates the issue of getting db error.

    Hope this helps!

  5. dsader
    Member
    Posted 17 years ago #

    The wpmu-users.php needs an else /path/ for domain if vhost=yes under the Blogs column as in the Blog Name column in wpmu-blogs.php.

    Looking at a list of domains is of no use in a non-vhost install.

    A workaround is to substitute "path" for "domain" in the following line in wpmu-users.php
    print '<a>userblog_id . '">' . str_replace( '.' . $current_site->domain, '', $val->domain) . '</a> (<a></a>

About this Topic