Gossamer Forum
Home : Products : DBMan : Installation :

Display last records first

Quote Reply
Display last records first
Hi
My name is carlos and a friend of mine just set dbman for me (I dont know about perl) but I am having some problems. When I search for list all I get the first records, according to date sent, first. I would like to have exactly the opposite, the newer records on top.
From what I read I have to change something in html.pl but what I tried didn't work and I'm afraid I'll mess up other thigs if I experiment on my own. Can you tell me how to do this?

Thank you in advance
carlos Fren
Quote Reply
Re: Display last records first In reply to
Look in your default.cfg file and see which number your date field is. For purposes of illustration, let's assume it's field 8. Then go to html.pl and find the line

print qq!| <A HREF="$db_script_link_url&view_records=1&$db_key=*">List All</A> ! if ($per_view);

It will be in the "sub html_footer" subroutine. Change the line to be

print qq!| <A HREF="$db_script_link_url&view_records=1&$db_key=*&sb=8&so=descend">List All</A> ! if ($per_view);

Substitute your date field number for the 8 above.



------------------
JPD


[This message has been edited by JPDeni (edited December 29, 1998).]
Quote Reply
Re: Display last records first In reply to
Thank you for the reply.
I did what you said but I get to the login screen, it says theres a login error, when I press List all.
I am using uid=default
Everything else seems to work ok. The default user is the way everybody will connect to the database.
Quote Reply
Re: Display last records first In reply to
Well, if you're getting a login error, the problem is in $db_script_link_url. And if everything else is working okay, my guess is that you might have made a typing error when you changed the script.

Is your database online? Could I take a look at it?





------------------
JPD
Quote Reply
Re: Display last records first In reply to
Thank you!
You were right, there was a ? in place of a &
(took me some time to find it and I would never had if it wasnt for your post, thanks)

I was thinking that tracking by date is not the perfect solution, since the two test posts I just sent do not display right (since the date is the same I guess).
Is it possible to display by ID (the newer ones first) since I read that every entry has a unique ID , though this is a hidden input in my database, I only see them when I delete records.
BTW my friend started from the demo database and what would be the first record now has an ID of 56. Is there a way to reset this to 0 after finishing the tests and start building the final database.

Thanks a lot
Carlos
Quote Reply
Re: Display last records first In reply to
 
Quote:
Thank you! You were right, there was a ? in place of a & (took me some time to find it and I would never had if it wasnt for your post, thanks)

No problem! I've done things like that myself. This is the hardest kind of error to find.

Quote:
I was thinking that tracking by date is not the perfect solution, since the two test posts I just sent do not display right (since the date is the same I guess). Is it possible to display by ID...

Sure. Just substitute your the number of your ID field in the "sb=8" structure above.

Quote:
Is there a way to reset this to 0 after finishing the tests and start building the final database.

Yep, there's a way.

Oh, you want to know what it is? Wink Open your default.count file and change whatever the number is in there to 0. Then upload it to your server. Voila!




------------------
JPD
Quote Reply
Re: Display last records first In reply to
Thanks a lot!
It's all working now.
There is still lots of things that I need to do before it goes live but the functionallity (if the word exists) is ok.

Thanks
Carlos