Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/joomla/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php Joomla 3.1.5拥有数据库模块,sql忽略_Php_Joomla_Joomla3.1 - Fatal编程技术网

Php Joomla 3.1.5拥有数据库模块,sql忽略

Php Joomla 3.1.5拥有数据库模块,sql忽略,php,joomla,joomla3.1,Php,Joomla,Joomla3.1,我尝试为Joomla 3.1.5创建简单的模块 模块在无问题安装中,但sql安装文件中的代码被忽略。当我卸载模块卸载脚本工作 我在instalaction sql中的代码 CREATE TABLE IF NOT EXISTS `#__mylist_songs`( `song_id` int(11) not null auto_increment PRIMARY KEY, `name` varchar(255) not null, `author` varchar(150) not null )E

我尝试为Joomla 3.1.5创建简单的模块

模块在无问题安装中,但sql安装文件中的代码被忽略。当我卸载模块卸载脚本工作

我在instalaction sql中的代码

CREATE TABLE IF NOT EXISTS `#__mylist_songs`(
`song_id` int(11) not null auto_increment PRIMARY KEY,
`name` varchar(255) not null,
`author` varchar(150) not null
)Engine=MyIsam  default charset=utf8;

CREATE TABLE IF NOT EXISTS `#__mylist_vote`(
`vote_id` int(11) not null auto_increment PRIMARY KEY,
`song_id` int(11) not null,
`ip` varchar(26),
`vote_date` datetime not null default '0000-00-00 00:00:00'
)Engine=MyIsam  default charset=utf8;
模块内xml

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

        <filename module="mod_mylist">mod_mylist.php</filename>
        <filename>script.php</filename>
        <folder>tmpl</folder>
        <filename>helper.php</filename>
        <filename>index.html</filename>
        <filename>mod_mylist.xml</filename>
        <filename>sql/mysql/install.mysql.utf8.sql</filename>
        <filename>sql/mysql/uninstall.mysql.utf8.sql</filename>
        <folder>sql</folder>
        <folder>sql/mysql</folder>
        <folder>sql/mysql/updates</folder>
    </files>
    <scriptfile>script.php</scriptfile>
但安装后DB中的模块并没有改变。当我在卸载sql脚本中出现语法错误时,joomla show error会显示错误,但在安装过程中没有错误

我不明白为什么。路径正确,我检查过了。

试试这个

 <install>
            <sql>
                <file charset="utf8" driver="mysql">sql/mysql/install.sql</file>
            </sql>
        </install>
    <uninstall>
            <sql>
                <file charset="utf8" driver="mysql">sql/mysql/uninstall.sql</file>
            </sql>
        </uninstall>
并且install.sql文件应该有查询。还要确保DB用户具有添加新表的权限。为了


希望对您有所帮助。

尝试对您的XML使用以下内容:

<files>
    <filename module="mod_mylist">mod_mylist.php</filename>
    <filename>index.html</filename>
    <filename>helper.php</filename>
    <folder>tmpl</folder>
    <folder>sql</folder>
</files>

我已经删除了对实际SQL文件的引用,因为如果您在标记中调用它们并清理其余部分,则不需要定义它们。

谢谢您的回答。不幸的是,这没有帮助。用户没有权限。脚本是正确的。文件名在文件系统和xml中更改。问题已解决。从zip文件安装模块时安装脚本工作。其中是从发现安装选项,或从tmp目录安装。@110precent-ahh很公平。你应该在你的问题中提到这一点;