Seite 1 von 1

Finde Fehler nicht :(

Verfasst: 24.02.2006 16:46
von DieterB
Hallo,

ich habe mein SubSilver mit 2 MOS's erweiter.
Seitdem taucht (beim Hinzufügen eines neuen Forums) folgende Fehlermeldung auf:
Couldn't insert row in forums table

DEBUG MODE

SQL Error : 1064 You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '', 1', 'SORT_FPDATE', 0, 0, 0, 0, 0, 1, 1, 3, 3, 1, 1)' at line

INSERT INTO phpbb_forums (forum_id, forum_name, cat_id, forum_desc, forum_order, forum_status, forum_sort, forum_notify, prune_enable, auth_view, auth_read, auth_post, auth_reply, auth_edit, auth_delete, auth_sticky, auth_announce, auth_vote, auth_pollcreate) VALUES ('41', 'testforum', 10, '', 30, 0', 1', 'SORT_FPDATE', 0, 0, 0, 0, 0, 1, 1, 3, 3, 1, 1)

Line : 416
File : admin_forums.php

Das ist der dazugehörige Code:

Code: Alles auswählen

VALUES ('" . $next_id . "', '" . str_replace("\'", "''", $HTTP_POST_VARS['forumname']) . "', " . intval($HTTP_POST_VARS[POST_CAT_URL]) . ", '" . str_replace("\'", "''", $HTTP_POST_VARS['forumdesc']) . "', $next_order, " . intval($HTTP_POST_VARS['forumstatus']) . "', " .intval($HTTP_POST_VARS['notify_enable']) . "', '" . str_replace("\'", "''", $HTTP_POST_VARS['forumsort']) . "', " . intval($HTTP_POST_VARS['prune_enable']) . $value_sql . ")";
Das passierte, nachdem ich die MOD's für das Sortieren der Foren eingebaut habe (Admin_Forums.php), danach für das Beobachten der Threads oder Postings.

Verfasst: 24.02.2006 17:54
von Dr.Death
Test das mal anstelle deines geposteten Codes:

Code: Alles auswählen

VALUES ('" . $next_id . "', '" . str_replace("\'", "''", $HTTP_POST_VARS['forumname']) . "', " . intval($HTTP_POST_VARS[POST_CAT_URL]) . ", '" . str_replace("\'", "''", $HTTP_POST_VARS['forumdesc']) . "', '" . $next_order . "', " . intval($HTTP_POST_VARS['forumstatus']) . "', " .intval($HTTP_POST_VARS['notify_enable']) . "', '" . str_replace("\'", "''", $HTTP_POST_VARS['forumsort']) . "', " . intval($HTTP_POST_VARS['prune_enable']) . $value_sql . ")"; 

Verfasst: 24.02.2006 18:04
von DieterB
Leider nein,

jetzt meckert er die Zeile 417 an.
Übrigens passiert das, wenn ich das Forum erstellen möcht, an dem Punkt, wo man eine Beschreibung angeben kann, und Berechtigungen vergeben kann.

Zeile 417 ist message_die

Code: Alles auswählen

VALUES ('" . $next_id . "', '" . str_replace("\'", "''", $HTTP_POST_VARS['forumname']) . "', " . intval($HTTP_POST_VARS[POST_CAT_URL]) . ", '" . str_replace("\'", "''", $HTTP_POST_VARS['forumdesc']) . "', '" . $next_order . "', " . intval($HTTP_POST_VARS['forumstatus']) . "', " .intval($HTTP_POST_VARS['notify_enable']) . "', '" . str_replace("\'", "''", $HTTP_POST_VARS['forumsort']) . "', " . intval($HTTP_POST_VARS['prune_enable']) . $value_sql . ")"; 

			if( !$result = $db->sql_query($sql) )
			{
				message_die(GENERAL_ERROR, "Couldn't insert row in forums table", "", __LINE__, __FILE__, $sql);
			}

Verfasst: 24.02.2006 20:12
von easygo
Versuchs mal so -->

Code: Alles auswählen

VALUES ('" . $next_id . "', '" . str_replace("\'", "''", $HTTP_POST_VARS['forumname']) . "', " . intval($HTTP_POST_VARS[POST_CAT_URL]) . ", '" . str_replace("\'", "''", $HTTP_POST_VARS['forumdesc']) . "', $next_order, " . intval($HTTP_POST_VARS['forumstatus']) . ", " . intval($HTTP_POST_VARS['notify_enable']) . ", '" . str_replace("\'", "''", $HTTP_POST_VARS['forumsort']) . "', " . intval($HTTP_POST_VARS['prune_enable']) . $value_sql . ")";
In deiner Zeile waren 2 single quotes zuviel drin. easy

Verfasst: 24.02.2006 20:23
von DieterB
jo,

jetzt funzt.

Mal eine Verständniss-Frage:

ich stelle immer wieder fest, dass manche dateien mehrfach vorhanden sind.
Z.B. auch die admin-forums.php

Frage: Warum?????

Verfasst: 24.02.2006 20:28
von easygo
Jo... nix zu danken. :-?