碎碎碎笺
碎碎碎笺
3491 5 0

我有一个在sae安装的问题

按照教程上传程序开了那些必要服务,开始还正常,但是一点哪个分类设置后网站就成:数据库出错:

MySQL Query Error
Mysql error description: Duplicate entry 'site_create' for key 'PRIMARY' 
Mysql error number: 1062 
Date: 2015-06-22 @ 14:49 
Script: http://8.partyone.sinaapp.com/ 这个样子了
0

See Also

Nearby


Discussion (5)

碎碎碎笺
碎碎碎笺 2015-06-22 06:52

这个怎么破啊?

0
youbbs
youbbs 2015-06-22 07:03

修改一下 model.php
https://github.com/ego008/youbbs-for-sae/blob/master/model.php#L19

    // 检测新增的 site_create
    if( $options['site_create']=='0' ){
        $DBM = new DB_MySQL;
        $DBM->connect($servername_m, $dbport, $dbusername, $dbpassword, $dbname);
        $query = "SELECT regtime FROM yunbbs_users WHERE id='1'";
        $m_obj = $DBS->fetch_one_array($query);
        if($m_obj){
            $site_create = $m_obj['regtime'];
            //$DBM->query("INSERT INTO yunbbs_settings VALUES('site_create', '$site_create')");
            $DBM->query("UPDATE `yunbbs_settings` SET `value` = '$site_create' WHERE `title` = 'site_create' LIMIT 1");
            $options['site_create'] = $site_create;
        }
    }

重新下载model.php 覆盖
即可 https://github.com/ego008/youbbs-for-sae/raw/master/model.php

0
碎碎碎笺
碎碎碎笺 2015-06-22 07:06

@youbbs 好的,谢谢我试一试

0
碎碎碎笺
碎碎碎笺 2015-06-22 07:14

@youbbs 现在有新问题呢,点击发帖就出现404,无法发帖,有什么方法可以解决吗?

0
youbbs
youbbs 2015-06-22 07:28

@碎碎碎笺 清空一下缓存看看

0
Login Topics