Platon Technologies
neprihlásený Prihlásiť Registrácia
SlovakEnglish
open source software development oslavujeme 10 rokov vývoja otvoreného softvéru! Streda, 11. november 2026
O nás
Magazín
Otvorený softvér
CVS
Služby
Index  »  Projekty  »  phpMyEdit  »  Fórum  »  Record sort order question (solved!)

phpMyEdit General     Record sort order question (solved!)
Odoslať novú tému   Odpovedať na tému    
 
dgroth     Založený: 25.03.2004   Príspevky: 3  
Príspevok Zaslal: 2004-03-25 20:00
Návrat hore  Odpovedať s citátom     

First thing: I am using phpMyEdit 5.4. I would like to offer my sincere praise the developers of this excellent utility. It is beyond my expectations.

My issue involves the sort_field option. I do not seem to understand how to use it correctly. I've configured phpMyEdit to display 10 records per page. I would it to open initially and display the last ten records which have been entered. My primary key is an auto-increment integer named 'Item' and the name of my date field, which I want to sort by, is simply named 'Date'. Here is the line of code I used to achieve this:

$opts['sort_field'] = '-Date';

I'm thinking that the above code would make my records display in descending order of the date. It does start with a page in which the records are displayed with the dates in decending order, but the page appears to be the first (oldest) group of records entered and not the last. If I click all the way back to page 1 of 1, then I see the very last records which were entered. How do I make it start by displaying the very last record entered and then desending downward chronologically?

Thanks in advance!


Naposledy upravil dgroth dňa 2004-03-26 20:03, celkom upravené 1 krát

 
michal     Založený: 17.06.2003   Príspevky: 537   Bydlisko: Slovakia
Príspevok Zaslal: 2004-03-25 22:28
Návrat hore  Odpovedať s citátom     

i was trapped with this also.

are you sure the field is Date and not date or DATE ?
also you can specify '-5' as order_field. where 5 is the number of the field (should be sfn[0] variable when you try to change the order manually clicking on the header). (date is maybe sql reserved word, not sure, maybe my_date will work)

 
dgroth     Založený: 25.03.2004   Príspevky: 3  
Príspevok Zaslal: 2004-03-25 23:48
Návrat hore  Odpovedať s citátom     

[quote="michal"]i was trapped with this also.

are you sure the field is Date and not date or DATE ?

I confirmed that my case sensitivety was correct. This is a very strange problem, but I am determined to figure it out. I think you may be correct about the word "Date" being a reserved SQL keyword. That may very well be the root of the problem. I will wait until no one is using the database and then modify to 'My_Date' or something. I will let you now if that fixes the problem.

Thanks!
Dave

 
dgroth     Založený: 25.03.2004   Príspevky: 3  
Príspevok Zaslal: 2004-03-26 20:02
Návrat hore  Odpovedať s citátom     

I was able to resolve this from looking at the recent bug postings. Here is what was causing this problem: When I upgraded to version 5.4, I forgot to replace the Language folder with the newer version also. As soon as I did this, everything began to work as expected.

Thanks,
Dave

 
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