MyBB Community Forums

Full Version: SMF 2.0.1 to Mybb 1.6.4 {Sql Error on Coverting PMS}
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3
MyBB SQL Error

MyBB has experienced an internal SQL error and cannot continue.

SQL Error:
    1054 - Unknown column 'import_pmid' in 'field list'
Query:
    INSERT INTO mybb_privatemessages (`import_pmid`,`uid`,`toid`,`fromid`,`recipients`,`folder`,`subject`,`icon`,`message`,`dateline`,`deletetime`,`status`,`statustime`,`includesig`,`smilieoff`,`receipt`,`readtime`,`pmid`) VALUES ('234','7','11','7','a:2:{i:0;s:1:\"7\";i:1;s:2:\"24\";}','1','Trophy Lost!','','bunny1313 Has Taken Your Trophy For mahjongg.','1143754896','0','1','0','0','','2','1320539919','')

How can this be fixed?
Well... stop using an outdated copy of some files and you'll be fine. This is due to having an outdated copy of merge/resources/modules/privatemessages.php
I downloaded it from the mybb merge system downloads page... is the SVN copy a better one to use?
(2011-11-06, 03:27 AM)Jaketfg Wrote: [ -> ]I downloaded it from the mybb merge system downloads page... is the SVN copy a better one to use?

Whats in the svn is the same file as in the release. When did you download it?
I just downloaded it today about six hours ago from the mybb site.
(2011-11-06, 03:31 AM)Jaketfg Wrote: [ -> ]I just downloaded it today about six hours ago from the mybb site.

Open up the file in question and paste the contents of the file here inside of php tags please.
<?php
/**
 * MyBB 1.6
 * Copyright 2009 MyBB Group, All Rights Reserved
 *
 * Website: http://www.mybb.com
 * License: http://www.mybb.com/about/license
 *
 * $Id: privatemessages.php 4395 2010-12-14 14:43:03Z ralgith $
 */

class Converter_Module_Privatemessages extends Converter_Module
{
	public $default_values = array(
		'import_pmid' => '',
		'uid' => 0,
		'toid' => 0,
		'fromid' => 0,
		'recipients' => '',
		'folder' => 1,
		'subject' => '',
		'icon' => '',
		'message' => '',
		'dateline' => 0,
		'deletetime' => 0,
		'status' => 0,
		'statustime' => 0,
		'includesig' => 0,
		'smilieoff' => '',
		'receipt' => 2,
		'readtime' => 0
	);
	
	/**
	 * Insert privatemessages into database
	 *
	 * @param pm The insert array going into the MyBB database
	 */
	public function insert($data)
	{
		global $db, $output;
		
		$this->debug->log->datatrace('$data', $data);
		
		$output->print_progress("start", $data[$this->settings['progress_column']]);
		
		// Call our currently module's process function
		$data = $this->convert_data($data);
		
		// Should loop through and fill in any values that aren't set based on the MyBB db schema or other standard default values
		$data = $this->process_default_values($data);
		
		foreach($data as $key => $value)
		{
			$insert_array[$key] = $db->escape_string($value);
		}
		
		unset($insert_array['import_pmid']);
		
		$this->debug->log->datatrace('$insert_array', $insert_array);
		
		$db->insert_query("privatemessages", $insert_array);
		$pmid = $db->insert_id();
		
		$db->insert_query("privatemessage_trackers", array(
			'pmid' => intval($pmid), 
			'import_pmid' => intval($data['import_pmid']),
		));
		
		$this->increment_tracker('privatemessages');
		
		$output->print_progress("end");
		
		return $pmid;
	}
}

?>
Well, the code to keep this from happening is right there...

        unset($insert_array['import_pmid']);

Please verify that the copy on the server contains this line.

(By the way, you used code tags instead of php like I asked Toungue )
Hi,

I can confirm the issue exists even today, with the merge code downloaded just now.
Yes, the file you refer to has the line you mention too.

Thanks.

(2011-11-06, 03:44 AM)Dylan M. Wrote: [ -> ]Well, the code to keep this from happening is right there...

        unset($insert_array['import_pmid']);

Please verify that the copy on the server contains this line.

(By the way, you used code tags instead of php like I asked Toungue )

Can you look in your MyBB database for the debuglogs table and tell us what it says for the row named $insert_array. Thanks Smile
Pages: 1 2 3