Seite 1 von 1

SQL-Fehler nach einbau von Bedankomat 0.2.0

Verfasst: 27.10.2005 17:17
von phpneuling
HI,habe den Bedankomat 0.2.0 eingebaut und der funktioniert auch teilweise,
z.B. bei alten Beiträgen aber wenn ich einen neuen schreiben möchte kommt diese Fehlermeldung:

Code: Alles auswählen

Allgemeiner Fehler
 
Error in posting

DEBUG MODE

SQL Error : 1136 Column count doesn't match value count at row 1

INSERT INTO phpbb_topics (topic_title, topic_bedankomat, topic_poster, topic_time, forum_id, topic_status, topic_type, topic_vote) VALUES ('11111', 2, 1130424481, 11, 0, 0, 0)

Line : 258
File : functions_post.php

Verfasst: 28.10.2005 08:30
von Supersonic
Da hat sich bei Dir ein kleiner Fehler eingeschlichen:

Zeile 255

Code: Alles auswählen

$sql  = ($mode != "editpost") ? "INSERT INTO " . TOPICS_TABLE . " (topic_title, topic_bedankomat, topic_poster, topic_time, forum_id, topic_status, topic_type, topic_vote) VALUES ('$post_subject', " . $userdata['user_id'] . ", $current_time, $forum_id, " . TOPIC_UNLOCKED . ", $topic_type, $topic_vote)" : "UPDATE " . TOPICS_TABLE . " SET topic_title = '$post_subject', topic_bedankomat = $topic_bedankomat, $topic_bedankomat, topic_type = $topic_type " . (($post_data['edit_vote'] || !empty($poll_title)) ? ", topic_vote = " . $topic_vote : "") . " WHERE topic_id = $topic_id";
sollte eigentlich so aussehen:

Code: Alles auswählen

$sql  = ($mode != "editpost") ? "INSERT INTO " . TOPICS_TABLE . " (topic_title, topic_bedankomat, topic_poster, topic_time, forum_id, topic_status, topic_type, topic_vote) VALUES ('$post_subject', $topic_bedankomat, " . $userdata['user_id'] . ", $current_time, $forum_id, " . TOPIC_UNLOCKED . ", $topic_type, $topic_vote)" : "UPDATE " . TOPICS_TABLE . " SET topic_title = '$post_subject', topic_bedankomat = $topic_bedankomat
, topic_type = $topic_type " . (($post_data['edit_vote'] || !empty($poll_title)) ? ", topic_vote = " . $topic_vote : "") . " WHERE topic_id = $topic_id";

Verfasst: 29.10.2005 11:03
von phpneuling
Hi,habe gerade den Code geändert und es funktioniert.
DANKE @ Supersonic

Verfasst: 30.10.2005 15:28
von phpneuling
HI Supersonic,

ich habe noch ein kleines Problem!
wenn ich ein neues Thema schreibe und diesen Beitrag Editieren möchte kommt diese Fehlermeldung:

Code: Alles auswählen

Allgemeiner Fehler
 
Error in posting

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 ' 18, 3, '', 1130680766, '7f000001', 1, 0, 1, 0)' at line 1

INSERT INTO phpbb_posts (topic_id, forum_id, poster_id, post_username, post_time, poster_ip, enable_bbcode, enable_html, enable_smilies, enable_sig) VALUES (, 18, 3, '', 1130680766, '7f000001', 1, 0, 1, 0)

Line : 271
File : functions_post.php
 
wenn ich den Code in Zeile 251 ändere,

Code: Alles auswählen

Zeile 251


vorher
	if ($mode == 'newtopic' || ($mode == 'editpost' && $post_data['first_post']))  

geändert
	if ($mode == 'newtopic' && ($mode == 'editpost' && $post_data['first_post']))  

	             
dann kann ich meinen Beitrag Editieren,nur dann habe ich das Problem das ich keine neue Beiträge schreiben kann ! es kommt die Fehlermeldung:

Code: Alles auswählen

Allgemeiner Fehler
 
Error in posting

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, topic_type = 0 WHERE topic_id = 195' at line 1

UPDATE phpbb_topics SET topic_title = 'TEST', topic_bedankomat = 1, 1, topic_type = 0 WHERE topic_id = 195

Line : 258
File : functions_post.php
meine functions_post.txt

ich hoffe du kannst mir noch einmal helfen?