method.install.php problem

Talk about writing modules and plugins for CMS Made Simple, or about specific core functionality. This board is for PHP programmers that are contributing to CMSMS not for site developers
Post Reply
User avatar
Ricko97
Forum Members
Forum Members
Posts: 65
Joined: Wed Jan 07, 2009 10:14 pm

method.install.php problem

Post by Ricko97 »

Alright, so having implemented a PM system into a number of sites using UDTs (resulting in horribly messy code), I decided to convert it to a CMSMS module. This is my first attempt at developing one and I'm not off to a good start  ::)

Basically, I can't get the darn thing to create the table (there's only one so far - avoiding use of the _seq table).

Below is the relevant part of my code (the rest is just permissions/log stuff):

Code: Select all

## DB initialization ##
$db =& $gCms->GetDb();
$dict = NewDataDictionary($db);
$table_dbtype = array('mysql'=>'TYPE=MyISAM', 'mysqli'=>'TYPE=MyISAM');

## Table schema ##
$table_schema = "
				id I(11) AUTO PRIMARY,
				title C(64),
				message X,
				from I(11),
				to I(11),
				from_viewed L,
				to_viewed L,
				from_deleted L,
				to_deleted L,
				from_vdate T,
				to_vdate T,
				from_ddate T,
				to_ddate T,
				created T
				";

## SQL execution ##
// Main table
$sqlarray = $dict->CreateTableSQL(cms_db_prefix().'module_privatemessages', $table_schema, $table_dbtype);
$dict->ExecuteSQLArray($sqlarray);
Anyone see anything wrong with it? I expect it's something to do with the table schema as I was including the _seq table at first, and that was being created with no issue at all.

Thanks in advance
User avatar
Ricko97
Forum Members
Forum Members
Posts: 65
Joined: Wed Jan 07, 2009 10:14 pm

Re: method.install.php problem

Post by Ricko97 »

Bump  :-\

I still can't see where I've gone wrong with this. I keep comparing the code (particularly the table schema) to that of other (working) modules and can't for the life of me figure out what's wrong. It must be something outside the method file, but if that's the case then I'm really stumped.

Otherwise, I must have done something really stupid  ???
Post Reply

Return to “Developers Discussion”