Reputation: 185
i'm currently working on a joomla module (using joomla 2.5), and I have to create a table to use it.
i follow this tutorial : http://docs.joomla.org/J2.5:Creating_a_simple_module/Developing_a_Basic_Module but when i install it, the table is not created.
here is my xml file :
<?xml version="1.0" encoding="utf-8"?>
<extension type="module" version="2.5.0" client="site" method="upgrade">
<name>Valid Order Module</name>
<author>Mathiewz</author>
<version>1.0.0</version>
<description>Module de validation des commandes !</description>
<files>
<filename module="mod_valid_order">mod_valid_order.php</filename>
<filename>index.html</filename>
<filename>helper.php</filename>
<filename>search.php</filename>
<filename>export_gc.php</filename>
<folder>tmpl</folder>
<folder>img</folder>
<folder>sql</folder>
</files>
<install>
<sql>
<file driver="mysql">sql/install.sql</file>
</sql>
</install>
<update>
<sql>
<file driver="mysql">sql/install.sql</file>
</sql>
</update>
<uninstall>
<sql>
<file driver="mysql">sql/uninstall.sql</file>
</sql>
</uninstall>
<config>
</config>
</extension>
i tried my sql request on phpmyadmin directly and it works, so i presume the problem is in the xml file
Upvotes: 1
Views: 2291
Reputation: 185
okay, i find the problem.
The table wasn't created because i didn't made propers uninstall before reinstall the module...
Upvotes: 1
Reputation: 19733
You have missed out the charset""
parameter. Try using the following:
<install>
<sql>
<file driver="mysql" charset="utf8">sql/install.sql</file>
</sql>
</install>
This is exactly what we use for our extensions, so it should work.
Hope this helps
Upvotes: 4