the simplest way would be to give each examtype the same name as the table it belongs in. Then you could just use that value in your query - but do a check to make sure it's a valid value first:
PHP Code:
$examtype = // your "super entity" value (do you mean "superglobal", e.g., $_POST or $_GET?)
$OKexamtypes = array('healthexam', 'radiology', 'alcoholtest');
if(in_array($examtype, $OKexamtypes)){
$table = $examtype;
$SQL = "INSERT INTO `$table` ('column1_name', 'column2_name', 'etc') VALUES ('column1_value', 'column2_value', 'etc')";
// then perform your query
}
Bookmarks