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

有帮助吗?

解决方案

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!

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top