freefcw / hustoj

the online judge system for acm/icpc
http://www.hustoj.org
265 stars 64 forks source link

Installation problem #48

Closed kevin50406418 closed 8 years ago

kevin50406418 commented 9 years ago

数据库连线正常网站出现“出错了,请联系freefcw#gmail的”资讯 查看日志档

出现以下数据:

1 /var/www/html/modules/database/classes/Kohana/Database.php(478): Kohana_Database_MySQL->escape('N')

2 /var/www/html/modules/database/classes/Kohana/Database/Query/Builder.php(116): Kohana_Database->quote('N')

3 /var/www/html/modules/database/classes/Kohana/Database/Query/Builder/Select.php(372): Kohana_Database_Query_Builder->_compile_conditions(Object(Database_MySQL), Array)

4 /var/www/html/modules/database/classes/Kohana/Database/Query.php(234): Kohana_Database_Query_Builder_Select->compile(Object(Database_MySQL))

5 /var/www/html/application/classes/Model/Base.php(116): Kohana_Database_Query->execute()

6 /var/www/html/application/classes/Model/News.php(76): Model_Base::find(Array, 1, 10, Array)

7 /var/www/html/application/classes/Controller/Index.php(14): Model_News::top_news()

8 /var/www/html/application/classes/Controller/Base.php(254): Controller_Index->action_index()

9 [internal function]: Controller_Base->execute()

10 /var/www/html/system/classes/Kohana/Request/Client/Internal.php(97): ReflectionMethod->invoke(Object(Controller_Index))

11 /var/www/html/system/classes/Kohana/Request/Client.php(114): Kohana_Request_Client_Internal->execute_request(Object(Request), Object(Response))

12 /var/www/html/system/classes/Kohana/Request.php(997): Kohana_Request_Client->execute(Object(Request))

13 /var/www/html/index.php(105): Kohana_Request->execute()

14 {main} in /var/www/html/modules/database/classes/Kohana/Database/MySQL.php:431

freefcw commented 9 years ago

我看这个问题应该是存在在数据库上,news的数据库上,能发布一下news数据库表结构么

kevin50406418 commented 9 years ago
栏位 型态 预设值
news_id(主键) int(11)
user_id varchar(48)
title varchar(200)
content text
time datetime 0000-00-00 00:00:00
importance tinyint(4) 0
defunct char(1) N

CREATE TABLE IF NOT EXISTS news ( news_id int(11) NOT NULL, user_id varchar(48) NOT NULL DEFAULT '', title varchar(200) NOT NULL DEFAULT '', content text NOT NULL, time datetime NOT NULL DEFAULT '0000-00-00 00:00:00', importance tinyint(4) NOT NULL DEFAULT '0', defunct char(1) NOT NULL DEFAULT 'N' ) ENGINE=MyISAM AUTO_INCREMENT=1004 DEFAULT CHARSET=utf8;

ALTER TABLE news ADD PRIMARY KEY (news_id);

ALTER TABLE news MODIFY news_id int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=1004;

freefcw commented 8 years ago

没看出什么问题来,缺少现场