MyBB Community Forums

Full Version: Internal SQL error and cannot continue. SQL Error: 22P02
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi,

I've just installed MyBB with PostgreSQL 9.3.4.

So far everything seems fine, except, I got the following error every time I remove a theme, regardless of what theme it is. My version of MyBB is 1.6.14 and PHP version is 5.4.30, running on FreeBSD 10. Web server is Nginx 1.7.3 if it makes a difference.

MyBB has experienced an internal SQL error and cannot continue.

SQL Error:
22P02 - ERROR: invalid input syntax for integer: "" LINE 2: SET pid='1' WHERE tid='' ^
Query:
UPDATE mybb_themes SET pid='1' WHERE tid=''


Is there anything I need to do? I cannot code too well but comfortable going inside files and make simple changes.

Thank you for your help.
On the page where it shows the form, does it actually have a field that has the theme id?
(2014-07-15, 09:45 PM)dragonexpert Wrote: [ -> ]On the page where it shows the form, does it actually have a field that has the theme id?

I'm not sure if you are referring to the page in the Admin CP where I delete the theme? I'm guessing something missing for me there. Picture attached. Thank you for the fast reply.
That would be the page. Either view the page source, or try using Inspect Element if you are using Chrome. Look for where a form tag begins and check.
(2014-07-15, 10:12 PM)dragonexpert Wrote: [ -> ]That would be the page. Either view the page source, or try using Inspect Element if you are using Chrome. Look for where a form tag begins and check.

I didn't find the form tag with view source on that page at all. Here is what the view source shows around that area. Thank you.

<div class="nav_tabs">	<ul>
		<li class=" first"><a href="index.php?module=style-themes&amp;action=add">Create New Theme</a></li>
		<li class=""><a href="index.php?module=style-themes&amp;action=import">Import a Theme</a></li>
		<li class=""><a href="index.php?module=style-themes&amp;action=browse">Browse Themes</a></li>
	</ul>
</div><div class="intro"><h2>Themes</h2><p>Here you can manage the themes set up on your forum. Themes allow you to customize the appearance of your forum. A list of the themes currently set up are shown below.</p></div><div class="border_wrapper">
	<div class="title">Themes</div>
<table class="general" cellspacing="0">
	<thead>
		<tr>
			<th class=" first" style="" width="">Theme</th>
			<th class="align_center" style="" width="100"># Users</th>
			<th class="align_center last" style="" width="150">Controls</th>
		</tr>
	</thead>
	<tbody>
		<tr class="first">
			<td class="first" style=""><div class="float_right"></div><div style="margin-left: 0px;"><strong>MyBB Master Style</strong></div></td>
			<td class="align_center alt_col" style="">0</td>
			<td class="align_center last" style=""><div class="popup_menu" id="theme_1_popup">
<div class="popup_item_container"><a href="index.php?module=style-themes&amp;action=export&amp;tid=1" class="popup_item">Export Theme</a></div>
</div>
<a href="javascript:;" id="theme_1" class="popup_button">Options</a>
<script type="text/javascript">
new PopupMenu('theme_1');
</script>
</td>
		</tr>
		<tr class="alt_row">
			<td class="first" style=""><div class="float_right"><a href="index.php?module=style-themes&amp;action=set_default&amp;tid=9&amp;my_post_key=42b17c7c0984fe8a971adfa61695fc5a"><img src="styles/sharepoint/images/icons/make_default.gif" alt="Set as Default" style="vertical-align: middle;" title="Set as Default" /></a></div><div style="margin-left: 20px;"><strong><a href="index.php?module=style-themes&amp;action=edit&amp;tid=9">Business</a></strong></div></td>
			<td class="align_center alt_col" style="">0</td>
			<td class="align_center last" style=""><div class="popup_menu" id="theme_9_popup">
<div class="popup_item_container"><a href="index.php?module=style-themes&amp;action=edit&amp;tid=9" class="popup_item">Edit Theme</a></div>
<div class="popup_item_container"><a href="index.php?module=style-themes&amp;action=delete&amp;tid=9&amp;my_post_key=42b17c7c0984fe8a971adfa61695fc5a" onclick="return AdminCP.deleteConfirmation(this, 'Are you sure you want to delete this theme?')" class="popup_item">Delete Theme</a></div>
<div class="popup_item_container"><a href="index.php?module=style-themes&amp;action=set_default&amp;tid=9&amp;my_post_key=42b17c7c0984fe8a971adfa61695fc5a" class="popup_item">Set as Default</a></div>
<div class="popup_item_container"><a href="index.php?module=style-themes&amp;action=force&amp;tid=9&amp;my_post_key=42b17c7c0984fe8a971adfa61695fc5a" onclick="return AdminCP.deleteConfirmation(this, 'Are you sure you want to force this theme on all users?')" class="popup_item">Force on Users</a></div>
<div class="popup_item_container"><a href="index.php?module=style-themes&amp;action=export&amp;tid=9" class="popup_item">Export Theme</a></div>
</div>
<a href="javascript:;" id="theme_9" class="popup_button">Options</a>
<script type="text/javascript">
new PopupMenu('theme_9');
</script>
</td>
</tr>
Do you use any plugins that may cause it? If not, it's probably a MyBB bug.
I do not have any plugins installed, except adding 2 or 3 themes. Otherwise, it is a brand new fresh install. Thank you.
(2014-07-17, 08:56 AM)kccg Wrote: [ -> ]I do not have any plugins installed, except adding 2 or 3 themes. Otherwise, it is a brand new fresh install. Thank you.

I experienced the same error when trying to delete a style or create a new one. My forum was updated to 1.8.3.
The last post is quite old. Any news on the subject?