Skip Site Navigation «

dbrowse

app«dbrowse
MySQL

Selected Data

This node is informative, descriptive, functional and terminating.
[definitions]

Query Path

Interactive Path

Description of Results

This MySQL table contains a small subset of the (many) MIME, or Internet media types, broken down by common file extension, and major and minor classifications. More information and resources regarding the records stored in this table can be located under the drx application category on Media Types.

The primary index mid is designed to be a foreign key linked by other tables that wish to assign a media type attribute to records contained there. This naturally includes the file table.

Another use for this table is to create a simple mapping of file extensions to media types. Consider the following function:

function media_type($ext) { global $_db; $_s = 'select major, minor from media where ext='; $_q = '\''; $_s .= $_q . $ext . $_q; $_r = mysql_query($_s, $_db); if ($type = mysql_fetch_row($_r)) { mysql_free_result($_r); return implode('/', $type); } return null; } // media_type() $ext = 'xhtml'; print $ext . ' = ' . media_type($ext);
xhtml = application/xhtml+xml

To review the structure and indexing for this table, step back a node. The records stored in this table are presented below.

Node/View

Table laz.media: Selected data.
mysql> select *
mysql> from laz.media
mysql> order by major,minor;
mid ext major minor
28 rows in set (0.0006 seconds)
6 mml application mathml+xml
10 pdf application pdf
27 rdf application rdf+xml
28 rss application rss+xml
7 php application x-httpd-php
8 phps application x-httpd-php-source
9 swf application x-shockwave-flash
1 xhtml application xhtml+xml
3 xml application xml
4 xsl application xml
5 dtd application xml-dtd
26 application xpath
2 xslt application xslt+xml
21 mp3 audio mpeg
15 gif image gif
12 jpg image jpeg
13 jpeg image jpeg
11 png image png
14 ico image x-icon
18 css text css
16 html text html
19 js text javascript
17 txt text plain
20 sgml text sgml
22 mpg video mpeg
23 mpeg video mpeg
24 mov video quicktime
25 qt video quicktime

Last updated: Tuesday, February 28th, 2006 @ 2:38 AM EST [2006-02-28T07:38:14Z]   home

(c) 2006-2008, Douglas W. Clifton, loadaveragezero.com, all rights reserved.