Platon Technologies
neprihlásený Prihlásiť Registrácia
SlovakEnglish
open source software development oslavujeme 10 rokov vývoja otvoreného softvéru! Streda, 25. november 2026
O nás
Magazín
Otvorený softvér
CVS
Služby
Index  »  Projekty  »  phpMyEdit  »  Fórum  »  How to sort numerically if the values are from foreign table

phpMyEdit General     How to sort numerically if the values are from foreign table
Odoslať novú tému   Odpovedať na tému    
 
amoghhooshdar     Založený: 30.01.2008   Príspevky: 2  
Príspevok Zaslal: 2008-01-30 11:18
Návrat hore  Odpovedať s citátom     

In my table I have an mid column.

Kód:
$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.

Kód:
/* 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:-

Kód:
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?

 
Odoslať novú tému   Odpovedať na tému    

Copyright © 2002-2006 Platon Group
Stránka používa redakčný systém Metafox
Na začiatok · Odkazový formulár · Prihláška
Upozorniť na chybu na PLATON.SK webstránke · Podmienky použitia · Ochrana osobných údajov