I submit a phrasetype and a table in language...
PHP Code:
function delete_phrasetype()
{
global $downloads, $db;
$db->query_write("DELETE FROM `phrasetype` WHERE `phrasetypeid`=".prep($downloads['phrasetype']['id'])." AND `product`=".prep($downloads['phrasetype']['product']));
$db->query_write("ALTER TABLE `language` DROP `phrasegroup_" . $downloads['phrasetype']['fieldname'] . "`");
}
function create_phrasetype()
{
global $downloads, $db;
$db->query_write("INSERT INTO `phrasetype` (`phrasetypeid`,`fieldname`,`title`,`product`) VALUES(".
prep($downloads['phrasetype']['id']).",".
prep($downloads['phrasetype']['fieldname']).",".
prep($downloads['phrasetype']['title']).",".
prep($downloads['phrasetype']['product']).")");
$db->query_write("ALTER TABLE `language` ADD `phrasegroup_" . $downloads['phrasetype']['fieldname'] . "` MEDIUMTEXT NOT NULL");
}
Any other suggestions?