Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

The Database Forum


You are currently viewing our The Database Forum as a guest. Please register to participate.
Login



Reply
Need to sort Users in Wordpress
Old 07-28-2009, 11:34 PM Need to sort Users in Wordpress
GeekSpecialties's Avatar
Super Talker

Posts: 132
Name: Leonard
Location: Minnesota, USA
Trades: 0
I installed a Wordpress plugin to display registered users and need it to sort by last name.

Here is the query I think needs to be changed.
Code:
$query = "SELECT ID, user_nicename FROM $wpdb->users WHERE ID = ANY (SELECT user_id FROM $wpdb->usermeta WHERE meta_value IN ($roles)) ORDER BY user_nicename LIMIT $offset, $usersPerPage";
The plugin author suggested this, but it did not work.
Code:
$query = "SELECT ID, user_nicename FROM $wpdb->users WHERE ID = ANY (SELECT user_id FROM $wpdb->usermeta WHERE meta_value IN ($roles)) ORDER BY $wpdb->usermeta.last_name LIMIT $offset, $usersPerPage";
Here is the link if you want to look at the whole php file.
http://wordpress.org/extend/plugins/wordpress-users/
GeekSpecialties is offline
Reply With Quote
View Public Profile Visit GeekSpecialties's homepage!
 
 
Register now for full access!
Old 07-29-2009, 09:25 PM Re: Need to sort Users in Wordpress
Super Talker

Posts: 130
Trades: 0
I'm not familiar with wordpress but the following should work.

PHP Code:
$query "SELECT ID, user_nicename FROM $wpdb->users WHERE ID = ANY (SELECT user_id FROM $wpdb->usermeta WHERE meta_value IN ($roles)) ORDER BY last_name LIMIT $offset$usersPerPage"
__________________
flann

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
flann is offline
Reply With Quote
View Public Profile
 
Old 07-29-2009, 11:39 PM Re: Need to sort Users in Wordpress
GeekSpecialties's Avatar
Super Talker

Posts: 132
Name: Leonard
Location: Minnesota, USA
Trades: 0
Yeah, that doesn't work. When I use that no users are displayed.
I've done a lot of searching the last couple of days, I'm not so sure it's possible.
if you have any ideas I'm all ears.

Thanks
GeekSpecialties is offline
Reply With Quote
View Public Profile Visit GeekSpecialties's homepage!
 
Reply     « Reply to Need to sort Users in Wordpress
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 1.46122 seconds with 12 queries