Itri
I tried that and still get error during the module installation. In particular, if I use or not this code I get the same thing: if the field doesn't exist it gets to be created, if the field exist I get an error message.
I don't know if it's the case of who posted this thread but, I solved simply in this way:
$sql = 'SELECT MY_FIELD from '._DB_PREFIX_.'TABLE';
if ($results = Db::getInstance()->ExecuteS($sql))
{
return true;
}
else {
if (!Db::getInstance()->execute(
'ALTER TABLE '._DB_PREFIX_.'TABLE ADD `MY_FIELD` varchar(16) NULL')) ;
return true;
}
So, if the field already exists, the funcion do nothing and if the field doesn't exist it will be created.
Thank you.