Seite 1 von 1

Installation problemlos, dann dieser SQL-Fehler

Verfasst: 02.04.2009 23:01
von Gab01
Hallo zusammen! :)

Ich bin an eine 2er Version des phpBB gekommen, weil ich mir bei Heise das i-study_1.6.3 (online-Seminar-Plattform) runtergeladen habe, das auf der Version 2.0.13 des phpBB aufgebaut ist.

Die Installation verlief absolut problemlos.
Als ich jedoch die vorhandenen Foren bearbeiten und neue erstellen wollte, bekam ich folgende Fehlermeldung:
Could not obtain recent topic information

DEBUG MODE

SQL Error : 1054 Unknown column 't.forum_id' in 'on clause'

SELECT t.*, u.username, u.user_id, u2.username as user2, u2.user_id as id2, p.post_username, p2.post_username AS post_username2, p2.post_time FROM forum_topics t, forum_users u, forum_posts p, forum_posts p2, forum_users u2 LEFT JOIN forum_forums f ON t.forum_id = f.forum_id WHERE t.topic_id IN (1, 2, 3, 4, 5, 6, 7, 8, 9, 14, 15, 16, 17, 18, 19, 20, 21) AND t.topic_poster = u.user_id AND p.post_id = t.topic_first_post_id AND p2.post_id = t.topic_last_post_id AND u2.user_id = p2.poster_id ORDER BY t.topic_last_post_id DESC LIMIT 10

Line : 470
File : portal.php

Ich habe dann die portal.php geöffnet und fand in Zeile 470 folgendes:

Code: Alles auswählen

{ 
   message_die(GENERAL_ERROR, 'Could not obtain recent topic information', '', __LINE__, __FILE__, $sql); 
}

Von php habe ich leider keine Ahnung, ich habe das nie kapiert.
Kann mir evtl. von Euch jemand helfen, dem Fehler auf die Spur zu kommen?
Ich wäre Euch wahnsinnig dankbar, da ich diese Plattform dringend brauche.

Vielen lieben Dank und liebe Grüße,
Gab01 :)

Re: Installation problemlos, dann dieser SQL-Fehler

Verfasst: 02.04.2009 23:08
von Mahony
Hallo
Schau mal hier Unknown column xxx' in 'on clause'

P.S. Der Fehler liegt in deiner portal.php



Grüße: Mahony

Re: Installation problemlos, dann dieser SQL-Fehler

Verfasst: 02.04.2009 23:22
von Gab01
Hallo Mahony,

zuerst einmal einen ganz lieben Dank für Deine superschnelle Antwort! :)

Im Großen und Ganzen habe ich verstanden, was gemeint ist, auch dass der Fehler in der portal.php behoben werden muss.
Da ich im MYSQL nichts kaputtmachen möchte, muss ich einfach nochmal nachfragen.

Der, bzw. die Fehler könnten eigentlich dann nur in diesem Abschnitt liegen:

Code: Alles auswählen

$sql = "SELECT t.*, u.username, u.user_id, u2.username as user2, u2.user_id as id2, p.post_username, p2.post_username AS post_username2, p2.post_time
	FROM " . TOPICS_TABLE . " t, " . USERS_TABLE . " u, " . POSTS_TABLE . " p, " . POSTS_TABLE . " p2, " . USERS_TABLE . " u2
	LEFT JOIN " . FORUMS_TABLE . " f
		ON t.forum_id = f.forum_id
	WHERE t.topic_id IN ($auth_results)
		AND t.topic_poster = u.user_id
		AND p.post_id = t.topic_first_post_id
		AND p2.post_id = t.topic_last_post_id
		AND u2.user_id = p2.poster_id
	ORDER BY t.topic_last_post_id DESC
	LIMIT 10"; 
if ( !($result = $db->sql_query($sql)) ) 
{ 
   message_die(GENERAL_ERROR, 'Could not obtain recent topic information', '', __LINE__, __FILE__, $sql); 
} 

while( $row = $db->sql_fetchrow($result) ) 
{
Wo genau aber müsste ich nun die Veränderungen machen?

Sorry, wenn ich blöd nachfrage, aber ich habe es mal geschafft eine MYSQL zu zersägen, weil ich einfach drauflosgeleegt habe, anstatt nochmal nachzufragen. Also bitte nicht böse sein, wenn ich mich jetzt etwas dumm anstelle.... :roll: :D :wink:

Re: Installation problemlos, dann dieser SQL-Fehler

Verfasst: 02.04.2009 23:28
von Mahony
Hallo
Einfach den Part zwischen FROM und JOIN in Klammer () setzen (bei der SQL Abfrage).

Also das

Code: Alles auswählen

$sql = "SELECT t.*, u.username, u.user_id, u2.username as user2, u2.user_id as id2, p.post_username, p2.post_username AS post_username2, p2.post_time
   FROM " . TOPICS_TABLE . " t, " . USERS_TABLE . " u, " . POSTS_TABLE . " p, " . POSTS_TABLE . " p2, " . USERS_TABLE . " u2
   LEFT JOIN " . FORUMS_TABLE . " f
      ON t.forum_id = f.forum_id
   WHERE t.topic_id IN ($auth_results)
      AND t.topic_poster = u.user_id
      AND p.post_id = t.topic_first_post_id
      AND p2.post_id = t.topic_last_post_id
      AND u2.user_id = p2.poster_id
   ORDER BY t.topic_last_post_id DESC
   LIMIT 10";  
in das hier ändern

Code: Alles auswählen

$sql = "SELECT t.*, u.username, u.user_id, u2.username as user2, u2.user_id as id2, p.post_username, p2.post_username AS post_username2, p2.post_time
   FROM (" . TOPICS_TABLE . " t, " . USERS_TABLE . " u, " . POSTS_TABLE . " p, " . POSTS_TABLE . " p2, " . USERS_TABLE . " u2 )
   LEFT JOIN " . FORUMS_TABLE . " f
      ON t.forum_id = f.forum_id
   WHERE t.topic_id IN ($auth_results)
      AND t.topic_poster = u.user_id
      AND p.post_id = t.topic_first_post_id
      AND p2.post_id = t.topic_last_post_id
      AND u2.user_id = p2.poster_id
   ORDER BY t.topic_last_post_id DESC
   LIMIT 10";  
Grüße: Mahony

Re: Installation problemlos, dann dieser SQL-Fehler

Verfasst: 02.04.2009 23:33
von Gab01
Daaaaaaaaaanke!!!!!!!!! :grin:
Du bist genial, vielen lieben Dank für Deine Hilfe, es hat geklappt!!!! :grin:

Großes Lob!!!!!
Solch eine schnelle Hilfe hatte ich noch in keinem Forum!!!! :wink:


Liebe Grüße,
Gab01