SQL ERROR [ mysql4 ] in viewtopic

Get help with installation and running phpBB 3.0.x here. Please do not post bug reports, feature requests, or MOD-related questions here.
Get Involved
Forum rules
END OF SUPPORT: 1 January 2017 (announcement)
Locked
ricjonhay
Registered User
Posts: 247
Joined: Tue Feb 16, 2010 6:08 pm

SQL ERROR [ mysql4 ] in viewtopic

Post by ricjonhay » Wed Jun 16, 2010 6:51 pm

Support Request Template
What version of phpBB are you using? phpBB 3.0.7-PL1
What is your board's URL? http://rpgworrld.com/phpBB3/viewtopic.p ... p=163#p163
Who do you host your board with? unsure
How did you install your board? Someone else installed my board for me
Is your board a fresh install or a conversion? Fresh Install
Do you have any MODs installed? Yes
Is registration required to reproduce this issue? No
What MODs do you have installed? topic tag mod
What styles do you currently have installed? english
What language(s) is your board currently using? english
Which database type/version are you using? MySQL 5
What is your level of experience? Comfortable with PHP and phpBB
When did your problem begin? I noticed the error when trying to view a page on my friends forum
Please describe your problem. SQL ERROR [ mysql4 ]

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 'AND t.template_id = s.template_id AND c.theme_id = s.theme_id AND i.imag' at line 4 [1064]

An SQL error occurred while fetching this page. Please contact the Board Administrator if this problem persists.
Generated by SRT Generator ($Rev: 3988 $)

A friend of mine asked me to install a mod for them but before I started I noticed the above error in viewtopic, their are not sure how long its been there or why, any suggestions to a fix please?

User avatar
RMcGirr83
Recognised Extension Developer
Posts: 21034
Joined: Wed Jun 22, 2005 4:33 pm
Location: Your display
Name: Rich McGirr
Contact:

Re: SQL ERROR [ mysql4 ] in viewtopic

Post by RMcGirr83 » Wed Jun 16, 2010 6:56 pm

Post up the 10 lines before and after that line from viewtopic.php
In times of change, learners inherit the earth, while the learned find themselves beautifully equipped to deal with a world that no longer exists - Eric Hoffer
Former Modifications/Extensions Team Member | My extensions
Appreciate the extensions/mods/support then buy me a beer
All requests for support via PM will be ignored

ricjonhay
Registered User
Posts: 247
Joined: Tue Feb 16, 2010 6:08 pm

Re: SQL ERROR [ mysql4 ] in viewtopic

Post by ricjonhay » Wed Jun 16, 2010 7:08 pm

Code: Select all

		'topic_id'			=> $row['topic_id'],
		'forum_id'			=> $row['forum_id'],
		'post_subject'		=> $row['post_subject'],
		'post_edit_count'	=> $row['post_edit_count'],
		'post_edit_time'	=> $row['post_edit_time'],
		'post_edit_reason'	=> $row['post_edit_reason'],
		'post_edit_user'	=> $row['post_edit_user'],
		'post_edit_locked'	=> $row['post_edit_locked'],

		// Make sure the icon actually exists
		'icon_id'			=> (isset($icons[$row['icon_id']]['img'], $icons[$row['icon_id']]['height'], $icons[$row['icon_id']]['width'])) ? $row['icon_id'] : 0,
		'post_attachment'	=> $row['post_attachment'],
		'post_approved'		=> $row['post_approved'],
		'post_reported'		=> $row['post_reported'],
		'post_username'		=> $row['post_username'],
		'post_text'			=> $row['post_text'],
		'bbcode_uid'		=> $row['bbcode_uid'],
		'bbcode_bitfield'	=> $row['bbcode_bitfield'],
		'enable_smilies'	=> $row['enable_smilies'],
		'enable_sig'		=> $row['enable_sig'],
		'friend'			=> $row['friend'],
		'foe'				=> $row['foe'],
	);

User avatar
Brf
Support Team Member
Support Team Member
Posts: 51863
Joined: Tue May 10, 2005 7:47 pm
Location: {postrow.POSTER_FROM}
Contact:

Re: SQL ERROR [ mysql4 ] in viewtopic

Post by Brf » Wed Jun 16, 2010 7:14 pm

I do not know where you pulled those lines from, but your error is actually occuring in session.php. It is from calling setup without a user-session being active.

User avatar
RMcGirr83
Recognised Extension Developer
Posts: 21034
Joined: Wed Jun 22, 2005 4:33 pm
Location: Your display
Name: Rich McGirr
Contact:

Re: SQL ERROR [ mysql4 ] in viewtopic

Post by RMcGirr83 » Wed Jun 16, 2010 7:15 pm

Whoops...wrong topic. :oops:
In times of change, learners inherit the earth, while the learned find themselves beautifully equipped to deal with a world that no longer exists - Eric Hoffer
Former Modifications/Extensions Team Member | My extensions
Appreciate the extensions/mods/support then buy me a beer
All requests for support via PM will be ignored

User avatar
Mr Topatoe
Registered User
Posts: 55
Joined: Mon Jun 07, 2010 5:51 pm

Re: SQL ERROR [ mysql4 ] in viewtopic

Post by Mr Topatoe » Wed Jun 16, 2010 7:16 pm

Brf wrote:I do not know where you pulled those lines from, but your error is actually occuring in session.php. It is from calling setup without a user-session being active.
How do you fix this problem?

[EDIT] Never mind, fixed

User avatar
Brf
Support Team Member
Support Team Member
Posts: 51863
Joined: Tue May 10, 2005 7:47 pm
Location: {postrow.POSTER_FROM}
Contact:

Re: SQL ERROR [ mysql4 ] in viewtopic

Post by Brf » Wed Jun 16, 2010 7:22 pm

You replace whatever code is broken with the original code from the phpBB install download. In this case it is probably somewhere in viewtopic.php, since that is the only one getting this problem.

ricjonhay
Registered User
Posts: 247
Joined: Tue Feb 16, 2010 6:08 pm

Re: SQL ERROR [ mysql4 ] in viewtopic

Post by ricjonhay » Wed Jun 16, 2010 7:22 pm

hey no worries I fixed it, it was a problem with viewtopic.php a fresh file cleaned it up ;)

Locked

Return to “[3.0.x] Support Forum”