[SOLVED]how to create table with component instalation?

For Joomla! 1.5 Coding related discussions, please use: http://groups.google.com/group/joomla-dev-general
Forum rules
Please use the mailing list here: http://groups.google.com/group/joomla-dev-general rather than this forum.
sebastian tm
Joomla! Apprentice
Joomla! Apprentice
Posts: 14
Joined: Mon May 17, 2010 2:32 pm

[SOLVED]how to create table with component instalation?

Postby sebastian tm » Tue May 18, 2010 12:34 pm

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
Last edited by sebastian tm on Thu May 20, 2010 5:38 am, edited 1 time in total.

User avatar
dam-man
Joomla! Exemplar
Joomla! Exemplar
Posts: 7961
Joined: Fri Sep 09, 2005 2:13 pm
Location: The Netherlands
Contact:

Re: how to create table with component instalation?

Postby dam-man » Tue May 18, 2010 6:47 pm

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>
Robert Dam - Joomla Forum Moderator
Dutch Boards | Joomla Coding Boards | English Support Boards

sebastian tm
Joomla! Apprentice
Joomla! Apprentice
Posts: 14
Joined: Mon May 17, 2010 2:32 pm

Re: how to create table with component instalation?

Postby sebastian tm » Wed May 19, 2010 7:15 am

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.
You do not have the required permissions to view the files attached to this post.

sebastian tm
Joomla! Apprentice
Joomla! Apprentice
Posts: 14
Joined: Mon May 17, 2010 2:32 pm

Re: how to create table with component instalation?

Postby sebastian tm » Wed May 19, 2010 5:50 pm

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.

sebastian tm
Joomla! Apprentice
Joomla! Apprentice
Posts: 14
Joined: Mon May 17, 2010 2:32 pm

Re: how to create table with component instalation?

Postby sebastian tm » Wed May 19, 2010 5:53 pm

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>

it still doesn't work -,-

User avatar
dam-man
Joomla! Exemplar
Joomla! Exemplar
Posts: 7961
Joined: Fri Sep 09, 2005 2:13 pm
Location: The Netherlands
Contact:

Re: how to create table with component instalation?

Postby dam-man » Wed May 19, 2010 8:09 pm

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
Robert Dam - Joomla Forum Moderator
Dutch Boards | Joomla Coding Boards | English Support Boards

sebastian tm
Joomla! Apprentice
Joomla! Apprentice
Posts: 14
Joined: Mon May 17, 2010 2:32 pm

Re: how to create table with component instalation?

Postby sebastian tm » Thu May 20, 2010 5:38 am

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.


Return to “Joomla! 1.5 Coding”

Who is online

Users browsing this forum: No registered users and 6 guests