this is what i need help with, i have this file mimes.php which conatine the following below. I have a function that read off of the file to tell the script what mime the file is.
<?
$files['jad'] = "text/vnd.sun.j2me.app-descriptor";
$files['JAD'] = "text/vnd.sun.j2me.app-descriptor";
$files['mid'] = "audio/midi";
$files['MID'] = "audio/midi";
$files['jpg'] = "image/jpeg";
$files['JPG'] = "image/jpeg";
$files['jpe'] = "image/jpeg";
$files['JPE'] = "image/jpeg";
?>
instead of going into there and editing each time that i want to add another mime i built a databae with the mimes and extension i want to use.
So i want to use this mysql loop to produce the same results as the above instead have it do it automatically entead of manualy.
MySQL_connect($host,$user,$pass);
MySQL_select_db($database) or die("Could not select database");
$query = "select * from ".$prefix."ext WHERE active = 'Yes'";
$result = MySQL_query($query);
WHILE ($rows = MySQL_fetch_array($result)){
print '$files[\''.$rows[extension].'\'] = "'.$rows[mime]."\";<BR>";
print '$files[\''.strtoupper($rows['extension']).'\'] = "'.$rows[mime]."\";<BR>";
}
With out the results getting dispalyed back to the screen