我有一个在sae安装的问题

By 碎碎碎笺 at 2015-06-22 14:52:06 • 439次点击

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

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/ 这个样子了

sae, 问题


这个怎么破啊?

碎碎碎笺 at 2015-06-22 14:52:15
1

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

// 检测新增的 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

youbbs at 2015-06-22 15:03:28
2

@youbbs 好的,谢谢我试一试

碎碎碎笺 at 2015-06-22 15:06:26
3

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

碎碎碎笺 at 2015-06-22 15:14:40
4

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

youbbs at 2015-06-22 15:28:04
5
登录 后发表评论