Seite 1 von 1

SQL Error : 1066 Not unique table/alias: 't'

Verfasst: 01.04.2007 16:18
von Tanja63
hi, blöder Fehler nach self_auth MOD einbau und ich komme net weiter :(

SQL Error : 1066 Not unique table/alias: 't'

SELECT u.username, u.user_absence, u.user_absence_mode, u.user_id, u.user_posts, u.user_from, u.user_from_flag, u.user_website, u.user_email, u.user_icq, u.user_aim, u.user_yim, u.user_skype, u.user_regdate, u.user_msnm, u.user_viewemail, u.user_rank, u.user_sig, u.user_sig_bbcode_uid, u.user_avatar, u.user_avatar_type, u.user_allowavatar, u.user_allowsmile, u.user_warnings, u.user_level, u.ct_miserable_user, u.user_birthday, u.user_next_birthday_greeting, u.user_allow_viewonline, u.user_session_time, p.*, u.user_gender, pt.post_text, pt.post_subject, pt.bbcode_uid, k.kategorie FROM orion_posts p, orion_users u, orion_posts_text pt, orion_topics t LEFT Join orion_topic_cat as k ON t.k_id=k.k_id , orion_topics t, orion_users u2 WHERE p.topic_id = 44 AND p.topic_id=t.topic_id AND t.topic_poster=u2.user_id AND ( u2.user_id=3 OR t.topic_type = 2) AND pt.post_id = p.post_id AND u.user_id = p.poster_id AND t.topic_id = 44 ORDER BY p.post_time ASC LIMIT 0, 14

Line : 529
File : viewtopic.php
Die Fehlermeldung erscheint nicht beim Adminacc, berechtigte Moderatoren & Supermod ... sondern ausschließlich mit dem Useracc.

die entsprechende Stelle in der viewtopic.php

Code: Alles auswählen


//
// Go ahead and pull all data for this topic
//

// Start add - Self auth MOD
$self_sql_tables = (intval($is_auth['auth_read']) == AUTH_SELF) ? " , ".TOPICS_TABLE." t, ".USERS_TABLE." u2" : "";
$self_sql = (intval($is_auth['auth_read']) == AUTH_SELF) ? " AND p.topic_id=t.topic_id AND t.topic_poster=u2.user_id AND ( u2.user_id=".$userdata['user_id']." OR t.topic_type = " . POST_ANNOUNCE .")"  : "";
// End add - Self auth MOD

$sql = "SELECT u.username, u.user_absence, u.user_absence_mode, u.user_id, u.user_posts, u.user_from, u.user_from_flag, u.user_website, u.user_email, u.user_icq, u.user_aim, u.user_yim, u.user_skype, u.user_regdate, u.user_msnm, u.user_viewemail, u.user_rank, u.user_sig, u.user_sig_bbcode_uid, u.user_avatar, u.user_avatar_type, u.user_allowavatar, u.user_allowsmile, u.user_warnings, u.user_level, u.ct_miserable_user, u.user_birthday, u.user_next_birthday_greeting, u.user_allow_viewonline, u.user_session_time, p.*, u.user_gender,  pt.post_text, pt.post_subject, pt.bbcode_uid, k.kategorie
   FROM " . POSTS_TABLE . " p, " . USERS_TABLE . " u, " . POSTS_TEXT_TABLE . " pt $self_sql_tables, " . TOPICS_TABLE. " t LEFT Join " .TOPIC_KAT. " as k  ON t.k_id=k.k_id
   WHERE p.topic_id = $topic_id  $self_sql
      $limit_posts_time
      AND pt.post_id = p.post_id
      AND u.user_id = p.poster_id
      AND t.topic_id = $topic_id
   ORDER BY p.post_time $post_time_order
   LIMIT $start, ".$board_config['posts_per_page'];
Bislang verlief meine Suche nach einer Lösung leider ins Leere :(
Wäre nett, wenn mir jemand auf die Sprünge hilft, allein kann ich diesen Fehler nicht beheben.

Danke

Verfasst: 01.04.2007 19:17
von S2B
Finde:

Code: Alles auswählen

// Start add - Self auth MOD
$self_sql_tables = (intval($is_auth['auth_read']) == AUTH_SELF) ? " , ".TOPICS_TABLE." t, ".USERS_TABLE." u2" : "";
$self_sql = (intval($is_auth['auth_read']) == AUTH_SELF) ? " AND p.topic_id=t.topic_id AND t.topic_poster=u2.user_id AND ( u2.user_id=".$userdata['user_id']." OR t.topic_type = " . POST_ANNOUNCE .")"  : "";
// End add - Self auth MOD 
Ersetze mit:

Code: Alles auswählen

// Start add - Self auth MOD
$self_sql_tables = (intval($is_auth['auth_read']) == AUTH_SELF) ? " , ".TOPICS_TABLE." t2, ".USERS_TABLE." u2" : "";
$self_sql = (intval($is_auth['auth_read']) == AUTH_SELF) ? " AND p.topic_id=t2.topic_id AND t2.topic_poster=u2.user_id AND ( u2.user_id=".$userdata['user_id']." OR t2.topic_type = " . POST_ANNOUNCE .")"  : "";
// End add - Self auth MOD 
:wink:

Verfasst: 01.04.2007 20:02
von Tanja63
cool, es läuft !

ich danke vielmals :)