Hi,
I've got a problem with a component that I'm making - I've added an SQL file with the following text in it..
DROP TABLE IF EXISTS `#__shop_options` ;
CREATE TABLE IF NOT EXISTS `#__shop_optiongroups` (
`OptionGroupID` int(11) NOT NULL AUTO_INCREMENT,
`OptionGroupName` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL,
PRIMARY KEY (`OptionGroupID`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci AUTO_INCREMENT=4 ;
When installing the component it installs the component but just wont create the database - if I then try and just enter the code using the execute function of the Database class it gives me an SQL error about there being a syntax error for MariaDB (something about 'near')
I've put this same code into PhpMyAdmin (replacing #_ with the database extension) and it created the table fine (the actual code came from a phpmyadmin export!).
Does anyone know why Joomla 4's SQL has an issue with this but PhpMyAdmin can create the table fine (there is other tables in my code too - but the error seems to be occurring on the first "DROP TABLE IF EXISTS" statement - if I remove the DROP TABLE statement and just have it as CREATE TABLE IF NOT EXISTS... I get the same error - and if I remove more SQL statements the error just moves on to the next statement.
Am I missing something and why does Phpmyadmin accept it but not Joomla - surely Phpmyadmin is running the same SQL code as Joomla??