ASK83 Posted November 4, 2008 Share Posted November 4, 2008 Hi, I'm currently developing a message center on a site and I'm trying to make options for sorting by name or date. The date is simple, because there is a date time stamp in my message table, but the name is a bit more complicated.. The message table only stores a user_id, which I can use joins to retrieve the name when processing and echoing, but would it work the same with the ORDER BY syntax? And to throw a little a curve ball into the situation, there are two different message senders - users and the user's aliases (stored in another table aside from users) - so how would I go about separating and ordering the names when initially querying the message table? Link to comment https://forums.phpfreaks.com/topic/131315-order-by-name-when-id-is-in-field/ Share on other sites More sharing options...
fenway Posted November 4, 2008 Share Posted November 4, 2008 Describe that "name" stituation in more detail. Link to comment https://forums.phpfreaks.com/topic/131315-order-by-name-when-id-is-in-field/#findComment-682109 Share on other sites More sharing options...
ASK83 Posted November 4, 2008 Author Share Posted November 4, 2008 There are two different ways the users can communicate - let's use this forum as a way to express this.. I can communicate by my login (ASK83), but let's say I was also trying to communicate to my neighbor who knows me by my first name (let's say John) - so I could send messages as my alias (ASK83) or my user (John). If that helps any. Link to comment https://forums.phpfreaks.com/topic/131315-order-by-name-when-id-is-in-field/#findComment-682264 Share on other sites More sharing options...
fenway Posted November 6, 2008 Share Posted November 6, 2008 OK... could you show me a query where this is an issue for you? Link to comment https://forums.phpfreaks.com/topic/131315-order-by-name-when-id-is-in-field/#findComment-683725 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.