I am using the following code for creating tables in my .sql
file as part of a module.
CREATE TABLE IF NOT EXISTS `#__gruposlocales` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(255) NOT NULL,
`latitude` float(10,6) NOT NULL DEFAULT '255.000000',
`longitude` float(10,6) NOT NULL DEFAULT '255.000000',
PRIMARY KEY (`id`)
) ENGINE=INNODB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;
INSERT INTO `#__gruposlocales` (`id`, `latitude`, `longitude`) SELECT userid, latitude, longitude FROM `#__community_users`;
INSERT INTO `#__gruposlocales` (`name`) SELECT name FROM `#__community_groups` WHERE id=ownerid;
However, when I try to install the module, I get this error:
JInstaller: :Install: Error SQL Unknown column 'latitude' in 'field list' Extension Install: SQL error processing query: DB function failed with error number 1054 Unknown column 'latitude' in 'field list' SQL =
INSERT INTO `#__gruposlocales` (`id`, `latitude`, `longitude`) SELECT userid, latitude, longitude FROM `#__community_users`;
Is my code wrong? Could anybody help to fix this, please?
#__helloworld
(hello
,lang
) VALUES ('Hello World', 'en-GB'); INSERT INTO#__helloworld
(hello
,lang
) VALUES ('Hola Mundo', 'es-ES'); INSERT INTO#__helloworld
(hello
,lang
) VALUES ('Bonjour tout le monde', 'fr-FR');