[Phpmyadmin-devel] RFD: New feature, Interface implementation (not a feature request! :-)

Garvin Hicking hicking at faktor-e.de
Thu Jan 30 03:17:02 CET 2003


Hi Robin!

> Our SQL query analyzer system can tell you what columns are aliased and
> much much more, so this shouldn't be a problem.

> I think the column name should not be used to define what type of
> transform is used, as that restricts the user a lot. Instead just base
> the transform off the specified mimetype.

Then I don't get the clue of how you want to add the mime-types. In your
first mail I thought you want to use the column comments table for storing
it. The column comments references the comments by the column name,
currently like this:

db_name.table_name.column_name:comment

There I would just add new fields: mimetype, parameters.

On the browsepage I would use a function which gets all fields mimetype and
parameters from the comments-database. In every field I would the check the
mimetype of the column using an association by the column name.

Which means exactly, I have an array like this:

$transformation_map = array('id' => 'text/plain', 'image' =>
'image/jpg_inline', 'image2' => 'image/jpg');

And after that, inside the loop for displaying the rows' values I query my
array via $transformation_map[$pointer] -- if there is an entry, to the
transformation stuff, otherwise use the standard
htmlspecialchars()-Function.

What was your approach, could you please specify?

> Oh, and once you write up the code for putting the mime-type in, I'll
> contribute a little bit of code that can auto-detect what mime-type a
> data field should be if there is data in the field but no mime-type
> specified. It's just a little bit of code I have kicking around my
> personal archives that I wouldn't mind putting to better use.

That'll be great. :-)

Regards,
Garvin.





More information about the Developers mailing list