So you want to hack into phpMyAdmin, huh?

Download: pma_hack_example

phpMyAdmin is the standard in web-based MySQL administration. Want to extend it? Here's some code to get you started. I had no itch to scratch here. I was just looking for something to play with. I decided that I would have it generate a class based on the table data, but my 1 1/2 hours dedicated to this is up, so the class is unfinished (you wouldn't need a class like this anyway). Still, you can get a sense of which include files to use and what the data structure looks like. It would be nice if the maintainers made it extensible (they did for the export functionality), but really, it is refactored spaghetti code. Still, it is not that difficult to hack in there. I don't expect you to run my code, which is why I didn't create a diff. Still, if you really want to, just drop both files in the root directory of your phpmyadmin installation (make a backup of tbl_structure.php first). I made this on Ubuntu, package version is: phpMyAdmin 2.10.3.

See that "Gen Custom Class" link?

So, if you really want to do this right, you would modify the language files and create a variable for your new link. I was lazy and just embedded it in the code. See tbl_structure.php in the tgz file. Note that the $url_query var has the query string, so you can probably pass this right into your script.

Here's what the output looks like

Download: pma_hack_example

Back to Code