phpMyAdmin "Browse"

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View

Is it possible to configure phpMyAdmin to show tables by DESCending
primary key by default when you hit 'Browse' ?

I found this in the config file:

// In browse mode...
$cfg['Order'] = 'ASC';  // default for 'ORDER BY' clause (valid
// values are 'ASC', 'DESC' or 'SMART' -ie
// descending order for fields of type
// ascending order else-)

But this only affects the ordering when you actually order the table,
and in any case, my primary keys are usually INTs.

Brian Wakem

Re: phpMyAdmin "Browse"

On Mon, 31 Jul 2006 11:25:02 +0100, Brian Wakem put finger to keyboard
and typed:

Quoted text here. Click to load it

I don't think so, because the default is unsorted (ie, leave it to the
MySQL default), and the MySQL default is sequential by creation (FIFO)
rather than any value internal to the data. So, unless you're actually
creating your primary keys backwards (ie, starting at a large number
and getting progressively smaller), if your primary key is an INT then
it will almost always appear in ascending numerical order unless you
specifically apply a different order.

Quoted text here. Click to load it

There may be a configuration to say something like "always order,
never use the default", in which case the browse mode ordering will
come into play on first view. But I'm not aware of any such switch in
the settings...

Please give me one!

Re: phpMyAdmin "Browse"

Brian Wakem wrote:
Quoted text here. Click to load it


The default is no ordering - so primary keys in ascending order are just
by coincidence.  Yes, if you use an autoincrement field, it will
generally be in ascending order, but that isn't guaranteed.

For instance, try the following:

  CREATE TABLE employees (empid INT(4) NOT NULL, empname VARCHAR(20) NOT
  INSERT INTO employees (empid, empname) VALUES (10, 'Tom');
  INSERT INTO employees (empid, empname) VALUES (5, 'Dick');
  INSERT INTO employees (empid, empname) VALUES (15, 'Harry');
  INSERT INTO employees (empid, empname) VALUES (3, 'Susan');

Now browse your table with phpMyAdmin.

You can click on the column name and phpMyAdmin will generate a new
query ordering by the indicated column.  Clicking again on the column
name will reorder by the column in the opposite direction.

Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.

Re: phpMyAdmin "Browse"

Jerry Stuckle wrote:

Quoted text here. Click to load it

Yes I am aware of all of that, I am looking for a shortcut.

Brian Wakem

Site Timeline