MySQLDumper-Board Forum Index Follow me on Twitter

Portal  •   Forum  •  Downloads  •  Profile  •  Search   •  Register  •  Log in to check your private messages  •  Log in  •  


 is there a way to set default sorting?

Post new topicReply to topic
Author Message
vesper8
knows MySQLDumper
knows MySQLDumper





Joined: 12 Feb 2010
Posts: 3


canada.gif

PostPosted: 2010-02-12, 21:51    is there a way to set default sorting? Reply with quoteBack to top

Hi there!

I love this program and it is so useful.

I have just one little quirk.. when I am editing entries in my tables.. I want to see the latest entries first and I always have to sort by ID, click "ID" once.. and then it sorts ASC.. and then click again to go DESC.

It would be great if I could make the default ordering of all my tables to show me the latest entries first (so ORDER BY <primary key> DESC) by default.

OfflineView user's profileSend private message    
Anzeigen











Posted:    Anzeigen Back to top


    
DSB
Developer
Developer




Age: 41
Joined: 30 Apr 2004
Posts: 16070
Location: Reichenberg bei Würzburg


germany.gif

PostPosted: 2010-02-12, 22:26    Re: is there a way to set default sorting? Reply with quoteBack to top

Hi vesper8,

« vesper8 » wrote:
It would be great if I could make the default ordering of all my tables to show me the latest entries first (so ORDER BY <primary key> DESC) by default.

Good suggestion!
If no Order-Statement is given, get the primary key of the table and sort it descending, so the latest entries are at the top of the list. This is exactly the way I would like to act MySQLDumper myself. I just can't understand why I didn't have that idea myself. Wink

While I am totally re-coding the SQLBrowser at the moment, you've hit the right time for your suggestion. I will try to implement that in the next version. Wink

Btw: I've moved this to "Feature Requests".

_________________
Gruß / Greetings, DSB

Teigwaren heißen Teigwaren, weil sie Teig waren.
Diejenigen, die lautstark darüber diskutieren, warum es nicht geht, mögen bitte jene nicht stören, die es gerade tun.

OfflineView user's profileSend private messageSend e-mailVisit poster's website    
vesper8
knows MySQLDumper
knows MySQLDumper





Joined: 12 Feb 2010
Posts: 3


canada.gif

PostPosted: 2010-02-12, 22:29    (No subject) Reply with quoteBack to top

That's great! I'm glad I could help.

Keep up the fantastic work!

OfflineView user's profileSend private message    
DSB
Developer
Developer




Age: 41
Joined: 30 Apr 2004
Posts: 16070
Location: Reichenberg bei Würzburg


germany.gif

PostPosted: 2010-02-12, 22:32    (No subject) Reply with quoteBack to top

Of course we will.Wink

I placed your suggestion on our internal todo-list. So we won't forget about it. Wink

_________________
Gruß / Greetings, DSB

Teigwaren heißen Teigwaren, weil sie Teig waren.
Diejenigen, die lautstark darüber diskutieren, warum es nicht geht, mögen bitte jene nicht stören, die es gerade tun.

OfflineView user's profileSend private messageSend e-mailVisit poster's website    
DSB
Developer
Developer




Age: 41
Joined: 30 Apr 2004
Posts: 16070
Location: Reichenberg bei Würzburg


germany.gif

PostPosted: 2010-02-12, 22:39    (No subject) Reply with quoteBack to top

You could save one click in version 1.24 stable if you edit the file sql.php and change line 55 from
$orderdir=(!isset($_GET['orderdir'])) ? '' : $_GET['orderdir'];

to
$orderdir=(!isset($_GET['orderdir'])) ? 'DESC' : $_GET['orderdir'];


This way a row is sorted descending the first click you hit it. Wink

_________________
Gruß / Greetings, DSB

Teigwaren heißen Teigwaren, weil sie Teig waren.
Diejenigen, die lautstark darüber diskutieren, warum es nicht geht, mögen bitte jene nicht stören, die es gerade tun.


Last edited by DSB on 2010-02-12, 22:41; edited 1 time in total

OfflineView user's profileSend private messageSend e-mailVisit poster's website    
vesper8
knows MySQLDumper
knows MySQLDumper





Joined: 12 Feb 2010
Posts: 3


canada.gif

PostPosted: 2010-02-12, 22:41    (No subject) Reply with quoteBack to top

Cool! I'll try that.

You know.. since ALL of my tables always systematically have a primary key column called "ID". I bet I could also modify a line in the sql.php so it starts off with ORDER BY ID DESC automatically.

Would you happen to know which line that would be? Smile

OfflineView user's profileSend private message    
DSB
Developer
Developer




Age: 41
Joined: 30 Apr 2004
Posts: 16070
Location: Reichenberg bei Würzburg


germany.gif

PostPosted: 2010-02-12, 22:45    (No subject) Reply with quoteBack to top

« vesper8 » wrote:
Would you happen to know which line that would be? Smile

This would be some extra coding. You'll first have to analyze the table if it has got a primary key and which and create the ORDER BY-Statement from that information.
Up to now there is no such thing and so it is not done by changing one line.

As I mentioned above I am on my way to totally re-code the SQLBrowser and will keep your suggestion in mind while doing that.

_________________
Gruß / Greetings, DSB

Teigwaren heißen Teigwaren, weil sie Teig waren.
Diejenigen, die lautstark darüber diskutieren, warum es nicht geht, mögen bitte jene nicht stören, die es gerade tun.


Last edited by DSB on 2010-02-12, 22:53; edited 2 times in total

OfflineView user's profileSend private messageSend e-mailVisit poster's website    
DSB
Developer
Developer




Age: 41
Joined: 30 Apr 2004
Posts: 16070
Location: Reichenberg bei Würzburg


germany.gif

PostPosted: 2010-02-12, 22:47    (No subject) Reply with quoteBack to top

« vesper8 » wrote:
I bet I could also modify a line in the sql.php so it starts off with ORDER BY ID DESC automatically.

Would you happen to know which line that would be? Smile

For your private purposes you could take a look at line 56 and replace '' with 'id' Wink

But this is not a solution I could implement for all users of MySQLDumper, because this will throw errors if a table doesn't have a row called "id".

_________________
Gruß / Greetings, DSB

Teigwaren heißen Teigwaren, weil sie Teig waren.
Diejenigen, die lautstark darüber diskutieren, warum es nicht geht, mögen bitte jene nicht stören, die es gerade tun.

OfflineView user's profileSend private messageSend e-mailVisit poster's website    
Display posts from previous:      
Post new topicReply to topic


 Jump to:   


Show permissions
Similar topics
Topic Author Forum Replies Posted
No new posts Changing default encoding skygod Errors and questions 2 2011-07-31, 11:26 View latest post
No new posts sql-browser: insert default NULL kayf Gelöst/Erledigt 10 2009-08-12, 13:07 View latest post
No new posts default kommentar für backup Konfigur... ltdeta Feature Requests 4 2007-12-29, 22:35 View latest post
No new posts Change of default encoding of backupfile GeoD Errors and questions 29 2007-04-07, 17:40 View latest post
No new posts Change default charset... mousi Errors and questions 2 2006-05-07, 10:57 View latest post

 
CrackerTracker © 2004 - 2012 CBACK.de

Powered by Orion based on phpBB © 2001, 2002 phpBB Group
CBACK Orion Style based on FI Theme
All times are GMT + 2 Hours

phpBB SEO