phpMyAdmin suggestion Dec05 '04
Rather than mentioning my suggestion right away, I want to give an introduction, description, and appropriate praise.
Praise first
phpMyAdmin is a fabulous PHP/SQL application, which runs through a browser, and can be accessed anywhere in the world.
Since MySQL lacks on the GUI side, phpMyAdmin is the best tool around, for interacting with your remote MySQL databases.
I work with phpMyAdmin every day of my life – from simple SQL statements, to complex queries.
Data is key, and phpMyAdmin is my access to that data.
This is promptly why I purchased the latest release of the book, Mastering phpMyAdmin for Effective MySQL Management. This book uncovers many secrets and efficiency tips, that allow you to work with phpMyAdmin more effectively.
An excellent treat, indeed.
mysql_fetch_array()
When working with PHP, to access my query results – I find that mysql_fetch_array() works best with holding all the column data, that I want to echo onto my web page.
Let’s say I write a query, and I’m ready to pull each row (result set) out, in order to access each piece of information. Here is some sample code:
# Grab the total number of rows returned
$result_numrows = $mysql_num_rows($query_result);
# For each row, repeat the following code, within the loop
for ($r=0; $r<$result_numrows; $r++)
{
$row = $mysql_fetch_array($query_result);
# Insert code to be repeated... (see next example below)
}
For the sake of this example, I didn’t "insert code to be repeated" – but if I did, the result could look something like phpMyAdmin’s result, which is a standard table:

Column reference
As you can see, each piece of data is located in a separate column.
In order to access each piece of data, I like to use the array index:
echo $row[3];
The alternative is to use the actual column name, such as:
echo $row["feedback"];
Like I said, I prefer to use the array index (number), over the actual column name. This helps with duplicate column names, if more than one table is joined in the query.
The problem with using the array index
The problem with using the array index to reference each piece of data, is that I always have to COUNT across, to see how each column would be "placed" in the array.
This is time–consuming, and aggravating – especially when the query result produces dozens of columns.
My suggestion
My suggestion to phpMyAdmin developers, is to show the column numbers above each field of a query result:

This would speed up interaction with phpMyAdmin, and allow developers to be more efficient when working with the PHP, in combination with phpMyAdmin.
Categories: PHP
, Services
, SQL ![]()
Add Feedback (view all)
Leave feedback
I also use MySQL CC, on both Windows and Linux platforms. There's something on the MySQL website about it being deprecated, but I'm uncertain... i ... Read more.
matthom
is published and produced by Matt Thommes - an independent publishing enthusiast, mobile blogger, content creator, informative writer, web developer from Chicago.
Never one to conform, Matt intends to promote the effect the web has on our lives, in an effort to intensify, instruct, and clarify all that is happening around us.
Similar Entries
- Bookmark phpMyAdmin queries (14 recent visits)
Stats
2 unique visits since November 2008
mysql_fetch_array() is a very cool function. I use it all the time. Although I don't use phpmyadmin I use a program called MySQL Control Cen ... Read more.