Page 1 of 1

Form posting to phpbb2 forum (error)

Posted: Fri Oct 05, 2007 12:23 am
by Aragent
Form posting to phpbb2 forum (Stumped)

Error in posting

Code: Select all

DEBUG MODE

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, 2, , '', 1191560798, '1819bc87', 1, 1, 1, 1)

Line : 177
File : ftw_app_form_submit.php
line 173

Code: Select all

$sql = "INSERT INTO " . POSTS_TABLE . " (topic_id, forum_id, poster_id, post_username, post_time, poster_ip, enable_bbcode, enable_html, enable_smilies, enable_sig) VALUES ($topic_id, $forum, $user, '', $current_time, '$user_ip', 1, 1, 1, 1)";
	if (!$db->sql_query($sql, BEGIN_TRANSACTION))
	{
		message_die(GENERAL_ERROR, 'Error in posting', '', __LINE__, __FILE__, $sql);
	}


		$post_id = $db->sql_nextid();


It appears to be generated in the phpbb_topics, topic id forum id topic title, are generated but under topic poster its generating a 0, and of course nothing is showing in the forum.

Should be pritty strait forward a Form when you hit submit generates a post to the apropriat catagory. I have bee working on this for a bit. I dont see anything in general in any of the code that should couse it not to post to the forum. ( I have tryed coding this form a few diferant ways now but each time they fail at acually posting the form to the Forum.

Posted: Fri Oct 05, 2007 12:48 am
by Hemlata
Hello,

Have you tried to run the following query directly on phpMyAdmin? Does it get successfully executed?

Regards,

Posted: Fri Oct 05, 2007 8:27 am
by Aragent

Code: Select all

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, 2, , '', 1191560798, '1819bc87', 1, 1, 1, 1 )
Im getting this error

Code: Select all

#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 ' '', 1191560798, '1819bc87', 1, 1, 1, 1)' at line 1
Im using MySQL server version: 4.1.20-max-log

Posted: Fri Oct 05, 2007 9:19 am
by John Cartwright

Code: Select all

VALUES (18, 2, , '', 
The problem is the poster_id is empty, suggesting the information was not properly saved in the session, or something along those lines.

This question really does not belong here, as it's specific to the phpbb software. You should try their forums.

Posted: Fri Oct 05, 2007 10:01 am
by Aragent
ok Jcart, thanks for that info, I will do that

I was thinking I was doing something off with my php form originaly.