| Index
» Projects
» phpMyEdit
» Forum
» Record sort order question (solved!) |
 |
dgroth
Joined: 25 Mar 2004
Posts: 3
Posted: 2004-03-25 20:00
Back to top
Reply with quote
|
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!
Last edited by dgroth on 2004-03-26 20:03, edited 1 time in total
|
michal
Joined: 17 Jun 2003
Posts: 537
Location: Slovakia
Posted: 2004-03-25 22:28
Back to top
Reply with quote
|
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
Joined: 25 Mar 2004
Posts: 3
Posted: 2004-03-25 23:48
Back to top
Reply with quote
|
[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
Joined: 25 Mar 2004
Posts: 3
Posted: 2004-03-26 20:02
Back to top
Reply with quote
|
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
|
|
Post new topic
Reply to topic
|
|
|
|