Консультация № 146535
09.10.2008, 07:28
0.00 руб.
09.10.2008, 08:17
0 5 0
Час добрый!
Подскажите пожалуйста! У меня в админке на сайте есть функция, которая показывает сист.
сообщения базы данных.
при заходе на форум выдает кучу
Код:
 MySQL Error! 
Query

SELECT COUNT(*) AS NewPostCount

FROM kpro6_f_topic AS Topic

LEFT JOIN kpro6_f_topic_read AS TRead
ON Topic.id = TRead.Topic
AND TRead.Usr = 1

WHERE forum_id = 8
AND ( TRead.ReadOn < Topic.last_post
OR TRead.ReadOn IS NULL )
AND Topic.last_post > '2008-09-25'


Error
Table 'wwwlandscaferu_best.kpro6_f_topic_read' doesn't exist

Page
http://wwww.

В чем и где может быть ошибка, движок написан немцами.

Выдернул из файла функций

Код:
 // ================================================================
// setTopicIconObj setzt das zutreffende icon fuer jeden beitrag
// ================================================================
function setTopicIconObj(&$topic, $forum)
{
global $db,$UID;
// Bug Fix by Olaf 14 Sep 2007 10:52
// don't use the Cookie to find out if the a post is new
$SQL_Post48h = ' Topic.last_post > \''.date('Y-m-d', strtotime(KOOBI_BOARD_NEWPOSTMAXAGE)).'\' ';
// Bug Fix by Olaf 14 Sep 2007 10:52

$HOT_VIEW_COUNT = 250;
$HOT_REPLY_COUNT = 20;
// post holen
$q_post = "SELECT id FROM " . PREFIX . "_f_post WHERE topic_id = " . $topic->id . " ORDER BY id DESC";
$r_post = $db->Query($q_post);
$post = $r_post->fetchrow();
// ==================================================
// alle uid's zum topic holen
$q_uid = "SELECT uid FROM " . PREFIX . "_f_post WHERE topic_id = " . $topic->id;
$r_uid = $db->Query($q_uid);
$uids = array();

while ($uid = $r_uid->fetchrow()) {
$uids[] = $uid->uid;
}
// ==================================================
// ==================================================

// Bug Fix by Olaf 14 Sep 2007 10:52
// don't use the Cookie to find out if the a post is new

$sql = "
SELECT COUNT(*) AS NewPostCount

FROM ".PREFIX."_f_topic AS Topic

LEFT JOIN ".PREFIX."_f_topic_read AS TRead
ON Topic.id = TRead.Topic
AND TRead.Usr = ".UID."

WHERE Topic.id=".$topic->id."
AND ( TRead.ReadOn < Topic.last_post
OR TRead.ReadOn IS NULL )
AND ".$SQL_Post48h."
";
$res = $db->Query($sql);
$NewPost = $res->fetchrow();
// Bug Fix by Olaf 14 Sep 2007 10:52


// neu oder nicht
$new = false;
// ==================================================
$file = "thread";
// eigene beitraege im thema vorhanden?
if (in_array($UID, $uids)) $file .= "_dot";
// ein "heisses" thema?
if ($topic->replies > $HOT_REPLY_COUNT || $topic->views > $HOT_VIEW_COUNT) $file .= "_hot";
// gesperrt?
if ($topic->status == FORUM_STATUS_CLOSED || $forum->status == FORUM_STATUS_CLOSED) $file .= "_lock";
// neue beitraege vorhanden?

// Bug Fix by Olaf 14 Sep 2007 10:52
// don't use the Cookie to find out if the a post is new
if ($NewPost->NewPostCount > 0) {
$file .= "_new";
$new = true;
}
// Bug Fix by Olaf 14 Sep 2007 10:52


$file .= ".gif";

switch ($topic->type) {
case TOPIC_TYPE_ANNOUNCE:
if ($new) {
$topic->statusicon = getIcon("announcement_new.gif", "announcement");
} else {
$topic->statusicon = getIcon("announcement_old.gif", "announcement");
}
break;
case TOPIC_TYPE_STICKY:
default:
$topic->statusicon = getIcon($file, $file);
}
}

Обсуждение

Неизвестный
09.10.2008, 08:27
общий
а эта (kpro6_f_topic_read) таблица есть в базе?
зайдите в mysql под root (или тем пользщователем, у которого есть права) и выполните
SHOW TABLES FROM wwwlandscaferu_best LIKE '%kpro6_f_topic_read%'
или, если есть WEB интерфейс для выполнения запросов, выполните запрос там. (например, MySQLAdmin и т.д.)
Неизвестный
09.10.2008, 08:29
общий
Да есть
Код:
 /*Column Information For - wwwlandscaferu_best.kpro6_f_topic*/
--------------------------------------------------------------

Field Type Collation Null Key Default Extra Privileges Comment
------------- -------------------- ----------------- ------ ------ ------------------- -------------- ------------------------------- -------
id int(11) NULL PRI (NULL) auto_increment select,insert,update,references
title varchar(200) cp1251_general_ci YES (NULL) select,insert,update,references
status int(11) NULL YES 0 select,insert,update,references
views int(11) NULL YES 0 select,insert,update,references
rating text cp1251_general_ci YES (NULL) select,insert,update,references
forum_id int(11) NULL YES 0 select,insert,update,references
icon smallint(5) unsigned NULL YES (NULL) select,insert,update,references
posticon smallint(5) unsigned NULL YES (NULL) select,insert,update,references
datum datetime NULL YES 0000-00-00 00:00:00 select,insert,update,references
replies int(10) unsigned NULL YES 0 select,insert,update,references
uid int(10) unsigned NULL YES 0 select,insert,update,references
notification text cp1251_general_ci YES (NULL) select,insert,update,references
type tinyint(1) NULL YES 0 select,insert,update,references
last_post datetime NULL YES (NULL) select,insert,update,references
last_post_id int(11) NULL YES (NULL) select,insert,update,references
opened tinyint(4) NULL YES 1 select,insert,update,references
last_post_int int(14) NULL YES 0 select,insert,update,references

/*Index Information For - wwwlandscaferu_best.kpro6_f_topic*/
-------------------------------------------------------------

Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
------------- ---------- -------- ------------ ----------- --------- ----------- -------- ------ ------ ---------- -------
kpro6_f_topic 0 PRIMARY 1 id A 8 (NULL) (NULL) BTREE

/*DDL Information For - wwwlandscaferu_best.kpro6_f_topic*/
-----------------------------------------------------------

Table Create Table
------------- ---------------------------------------------------------
kpro6_f_topic CREATE TABLE `kpro6_f_topic` (
`id` int(11) NOT NULL auto_increment,
`title` varchar(200) default NULL,
`status` int(11) default '0',
`views` int(11) default '0',
`rating` text,
`forum_id` int(11) default '0',
`icon` smallint(5) unsigned default NULL,
`posticon` smallint(5) unsigned default NULL,
`datum` datetime default '0000-00-00 00:00:00',
`replies` int(10) unsigned default '0',
`uid` int(10) unsigned default '0',
`notification` text,
`type` tinyint(1) default '0',
`last_post` datetime default NULL,
`last_post_id` int(11) default NULL,
`opened` tinyint(4) default '1',
`last_post_int` int(14) default '0',
PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=9 DEFAULT CHARSET=cp1251
Неизвестный
09.10.2008, 14:55
общий
Решил проблему создал SQL запрос в базу данных
Код:
 -- 
-- Структура таблицы `kpro6_f_topic_read`
--

CREATE TABLE `kpro6_f_topic_read` (
`Usr` int(11) NOT NULL default '0',
`Topic` int(11) NOT NULL default '0',
`ReadOn` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
PRIMARY KEY (`Usr`,`Topic`)
) ENGINE=MyISAM DEFAULT CHARSET=cp1251;

--
-- Дамп данных таблицы `kpro6_f_topic_read`
--
Неизвестный
09.10.2008, 15:11
общий
ну и хорошо что получилось
но
Да есть
не понял.. что есть? если Вы о таблице - то её нет.. не вижу (хотя, Вы показали не тот вывод).
wwwlandscaferu_best.kpro6_f_topic это не wwwlandscaferu_best.kpro6_f_topic_read
Создали - это хорошо.. сейчас работает?
Неизвестный
09.10.2008, 15:33
общий
Простите не разглядел
Форма ответа