Question

I am developing a joomla component. I need to import a sql view in my project.

create view view_name as select * from my_table

Was it helpful?

Solution

How you tried in your xml file add something like

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

And the install.sql file should have the query. Also make sure the DB user have permission to add new tables.

Its Done!

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top