Form posting to phpbb2 forum (error)

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Aragent
Forum Newbie
Posts: 3
Joined: Thu Oct 04, 2007 11:51 pm

Form posting to phpbb2 forum (error)

Post 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.
Hemlata
Forum Commoner
Posts: 35
Joined: Mon Sep 10, 2007 5:40 am
Location: India
Contact:

Post by Hemlata »

Hello,

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

Regards,
Aragent
Forum Newbie
Posts: 3
Joined: Thu Oct 04, 2007 11:51 pm

Post 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
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post 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.
Aragent
Forum Newbie
Posts: 3
Joined: Thu Oct 04, 2007 11:51 pm

Post 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.
Post Reply