Platon Technologies
not logged in Login Registration
EnglishSlovak
open source software development celebrating 10 years of open source development! Wednesday, November 11, 2026
About Us
Magazine
Open Source
CVS
Services
Index  »  Projects  »  phpMyEdit  »  Forum  »  How to sort numerically if the values are from foreign table

phpMyEdit General     How to sort numerically if the values are from foreign table
Post new topic   Reply to topic    
 
amoghhooshdar     Joined: 30 Jan 2008   Posts: 2  
Post Posted: 2008-01-30 11:18
Back to top  Reply with quote     

In my table I have an mid column.

Code:
$opts['fdd']['mid'] = array(
  'name'     => 'Member ID',
  'select'   => 'T',
  'maxlen'   => 4,
  'sort'     => true,
);


However, this MID is a foreign key in another table:-

FOREIGN KEY (mid) references members(mid)

So, in my table, I tried to show the description of each mid from the foreign table using the following code.

Code:
/* Show description from the foreign table. */
$opts['fdd']['mid']['values']['table'] = 'members';
$opts['fdd']['mid']['values']['column'] = 'mid';
$opts['fdd']['mid']['values']['description']['columns'][0] = 'mid';
$opts['fdd']['mid']['values']['description']['divs'][0] = ' - ';
$opts['fdd']['mid']['values']['description']['columns'][1] = 'description';


So, now my "Member ID" column shows something like:-

Code:
1 - By approval
10 - New joinee
11 - New joinee
12 - By approval
2 - By approval
20 - Unknwon
21 - Unknown
3 - New
4 - New


So, you can see it has alphabetically sorted the first column on the basis of <mid> - <description>.

I want to sort it numerically on the basis of MID only. Is this possible?

 
Post new topic   Reply to topic    

Copyright © 2002-2006 Platon Group
Site powered by Metafox CMS
Go to Top · Feedback form · Application form
Report bug on PLATON.SK website · Terms of use · Privacy policy