Hi,
i'm trying to make a joomla 1.5 component, but there are some tables that i need to create when installing.
i saw that in joomla 1.0 i would just add in the components xml file, the query between some <queries></queries> tags.
thanks,
sebastian
[SOLVED]how to create table with component instalation?
-
- Joomla! Apprentice
- Posts: 14
- Joined: Mon May 17, 2010 2:32 pm
[SOLVED]how to create table with component instalation?
Last edited by sebastian tm on Thu May 20, 2010 5:38 am, edited 1 time in total.
- dam-man
- Joomla! Exemplar
- Posts: 7961
- Joined: Fri Sep 09, 2005 2:13 pm
- Location: The Netherlands
- Contact:
Re: how to create table with component instalation?
You can add an install.sql file, this needs to be called by the installer.
This can be added to your XML file during install, it will check if there is a file named install.sql in your backend folder.
<install>
<sql>
<file charset="utf8" driver="mysql">install.sql</file>
</sql>
</install>
<uninstall>
<sql>
<file charset="utf8" driver="mysql">uninstall.sql</file>
</sql>
</uninstall>
This can be added to your XML file during install, it will check if there is a file named install.sql in your backend folder.
<install>
<sql>
<file charset="utf8" driver="mysql">install.sql</file>
</sql>
</install>
<uninstall>
<sql>
<file charset="utf8" driver="mysql">uninstall.sql</file>
</sql>
</uninstall>
Robert Dam - Joomla Forum Moderator
Dutch Boards | Joomla Coding Boards | English Support Boards
Dutch Boards | Joomla Coding Boards | English Support Boards
-
- Joomla! Apprentice
- Posts: 14
- Joined: Mon May 17, 2010 2:32 pm
Re: how to create table with component instalation?
thanks for your help.
i keep getting an error:
*Error! Could not find a Joomla! XML setup file in the package.
I have attached my xml files.
I realy don't know what's wrong with it.
If i remove the SQL part, I receive:
* XML Parsing Error at 27:16. Error 76: Mismatched tag
* Component Install: The XML file did not contain an administration element.
i keep getting an error:
*Error! Could not find a Joomla! XML setup file in the package.
I have attached my xml files.
I realy don't know what's wrong with it.
If i remove the SQL part, I receive:
* XML Parsing Error at 27:16. Error 76: Mismatched tag
* Component Install: The XML file did not contain an administration element.
You do not have the required permissions to view the files attached to this post.
-
- Joomla! Apprentice
- Posts: 14
- Joined: Mon May 17, 2010 2:32 pm
Re: how to create table with component instalation?
i've solved the errors, it seems that you get errors from the zip file.
i used to modify the archive with total commander and kept getting errors.
now every time i want to modify the files before the install i make a fresh new compressed folder with windows' send to ->compressed folder.
and it works.
i used to modify the archive with total commander and kept getting errors.
now every time i want to modify the files before the install i make a fresh new compressed folder with windows' send to ->compressed folder.
and it works.
-
- Joomla! Apprentice
- Posts: 14
- Joined: Mon May 17, 2010 2:32 pm
Re: how to create table with component instalation?
it still doesn't work -,-dam-man wrote:You can add an install.sql file, this needs to be called by the installer.
This can be added to your XML file during install, it will check if there is a file named install.sql in your backend folder.
<install>
<sql>
<file charset="utf8" driver="mysql">install.sql</file>
</sql>
</install>
<uninstall>
<sql>
<file charset="utf8" driver="mysql">uninstall.sql</file>
</sql>
</uninstall>
- dam-man
- Joomla! Exemplar
- Posts: 7961
- Joined: Fri Sep 09, 2005 2:13 pm
- Location: The Netherlands
- Contact:
Re: how to create table with component instalation?
Are you have the install files in the zip files and are they uploaded to your server?
This is needed to make it work properly
This is needed to make it work properly
Robert Dam - Joomla Forum Moderator
Dutch Boards | Joomla Coding Boards | English Support Boards
Dutch Boards | Joomla Coding Boards | English Support Boards
-
- Joomla! Apprentice
- Posts: 14
- Joined: Mon May 17, 2010 2:32 pm
Re: how to create table with component instalation?
It works now. thank you very much.
i thought that the <install> tag should be only once, and the <uninstall> tag at the end.
after the description i added both and worked fine.
i thought that the <install> tag should be only once, and the <uninstall> tag at the end.
after the description i added both and worked fine.