Answer the question
In order to leave comments, you need to log in
How to add PREFIX tables to install.sql in OpenCart 2 OCMOD when installing the module?
By default, tables in the database have the prefix oc_
Among the installed modules, I see that people write like this: oc_table
But what happens if I have a different prefix?
How can I use it to modify tables with install.sql?
Answer the question
In order to leave comments, you need to log in
So far I have achieved the result using the install.php file
$query = "ALTER TABLE `".DB_PREFIX."category_description`
ADD `name_genitive` VARCHAR( 100 ) NOT NULL AFTER `name`,
ADD `name_singular` VARCHAR( 100 ) NOT NULL AFTER `name_genitive`; ";
$result = $this->db->query($query);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question