简体   繁体   中英

Joomla plugin database table

I am working on a plugin that handles logs, as such it needs its own database table. However doing the typical manifest does not seem to work and is causing errors. Not sure where I may be going wrong as searching this issue has yielded no results.

<install>
   <sql>
      <file driver="mysql" charset="utf8">sql/mysql/install.mysql.utf8.sql</file>
   </sql>
</install>

I tested the SQL in phpmyadmin and it works fine. All it needs to do is create a simple table with 4 columns.

I'm not sure it makes sense to do it: if you create a table, you need to provide some management features, at least view and delete / empty, so you typically would want to write a component for that. You could then build a package and distribute them in one file.

If you really want to try, another option could be to create the table in a postflight event, you can write a function to be invoked after installation (typically used to enable the plugin) and create the table there.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM