Reputation: 6138
I have a VIEW that keeps track of how a specific user (author) interacts with other users (receiever). See VIEW:
Here you can see how AUTHOR (the user_id) interacts with the other users by posting on his wall (post), liking their stuff (like) and also follows. Is there a way I can order the table POSTS with this VIEW? What I'd like to achieve is to show the wall posts (table: posts) and move the most relevant posts (the posts where the reciever ID appear most).
The posts table looks like this:
I'd like to order the post_author (from above table) against receiver (in the view).
Any ideas?
Upvotes: 0
Views: 30
Reputation: 1404
Yes, You have to bulid a variable wich contains all ID's in correct order nad put them into field()
function
ORDER BY FIELD(ID, (id's to order by))
EDIT: Here is tutorial: http://www.imthi.com/blog/programming/mysql-order-by-field-custom-field-sorting.php
Upvotes: 1