This script accepts a hostname and database name from the user and then uses HTTP basic authentication to get a username and password from the user. It tries to connect to the named mysql database on the named host using the supplied username and password. If it fails, it prompts the user for a new username and password.
Once successful, the script queries the database for all tables, and then queries each table for all fields. It outputs a form that has a section each each table listing each field.
The user can then fill in some or all of the fields, and press one of three supplied buttons, SELECT, INSERT, DELETE, to take an appropriate action. In using SELECT, there are several special options:
If the value supplied is prefixed by an <, =, >, or ~, then that specific comparison is used instead of the default = (~ becomes LIKE).
If the value begins with a '$', the remainder is taken as a field name in this or another table (i.e., it is not quoted), so that an inner join or self-join can be performed.