Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SQL

prestashop alter table if not exists

$columnExists = Db::getInstance()->executeS('SHOW COLUMNS FROM `' . _DB_PREFIX_ . 'orders`  LIKE 'sendnow'');

if (empty($columnExists)) {
    $sql[] = 'ALTER TABLE `' . _DB_PREFIX_ . 'orders`
            ADD sendnow tinyInt(1);';
}
 
PREVIOUS NEXT
Tagged: #prestashop #alter #table #exists
ADD COMMENT
Topic
Name
8+6 =