December 13th 2006 11:43 pm

Vertical MySQL Result Output

Ever had the results of a mysql query explode all over your terminal window like this:

mysql> select * from agtAgents limit 1;
+---------+------------+---------------+-----------+-------+-
--------+-------------+
| agentID | divisionID | corporationID | stationID | level |
quality | agentTypeID |
+---------+------------+---------------+-----------+-------+-
--------+-------------+
| 3008416 |        13 |      1000002 |  60000004 |    1 |
-18 |          2 |
+---------+------------+---------------+-----------+-------+-
--------+-------------+
1 row in set (0.00 sec)

That’s not the easiest thing in the world to read, much less make sense of. To make the output a little easier on the eyes, try ending your query with a \G:

mysql> select * from agtAgents limit 1 \G
*************************** 1. row ***************************
      agentID: 3008416
  divisionID: 13
corporationID: 1000002
    stationID: 60000004
        level: 1
      quality: -18
  agentTypeID: 2
1 row in set (0.00 sec)

No Comments yet »

Trackback URI | Comments RSS

Leave a Reply

You must be logged in to post a comment.

« Suppress errors in PHP function calls | Marco Tabini: 5 PHP Performance Tips You Probably Don’t Want To Hear »