When installing our component, we will need to create the necessary table. After all, we want to make things as automatic as possible and, unlike in modules, components are able to execute SQL queries during installation.
As there is the possibility of running queries during component installation, we
are going to make use of this useful feature. In fact, it's quite easy. First we
need to modify our
tinynews.xml file, as follows:
... </files> <install> <sql> <file charset="utf8" driver="mysql">install.sql</file> </sql> </install> <uninstall> <sql> <file charset="utf8" driver="mysql">uninstall.sql</file> </sql> </uninstall> <administration> <menu>Component Tinynews</menu> <files folder="admin"> <filename>tinynews.php</filename> ...