Thanks for the quick reply, they're not varchars - it's just my bad habits brought on by other languages. A dump of my current table is below:
-- --------------------------------------------------------
--
-- Table structure for table `wiki_pageContents`
--
CREATE TABLE IF NOT EXISTS `wiki_pageContents` (
`wikiTemplateDefinitionID` int(11) NOT NULL DEFAULT '0',
`wikiPageID` int(11) NOT NULL DEFAULT '0',
`wikiTemplateID` int(11) NOT NULL DEFAULT '0',
`content` text,
PRIMARY KEY (`wikiPageID`,`wikiTemplateID`,`wikiTemplateDefinitionID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `wiki_pageContents`
--
INSERT INTO `wiki_pageContents` (`wikiTemplateDefinitionID`, `wikiPageID`, `wikiTemplateID`, `content`) VALUES
(1, 1, 1, 'I am linked to heading 1 and wiki page 1'),
(2, 1, 1, 'I am linked to heading 2 and wiki page 1'),
(2, 2, 1, 'I am linked with heading 2 and wiki page 2');
-- --------------------------------------------------------
--
-- Table structure for table `wiki_pages`
--
CREATE TABLE IF NOT EXISTS `wiki_pages` (
`wikiPageID` int(11) NOT NULL AUTO_INCREMENT,
`wikiTemplateID` int(11) DEFAULT NULL,
PRIMARY KEY (`wikiPageID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=3 ;
--
-- Dumping data for table `wiki_pages`
--
INSERT INTO `wiki_pages` (`wikiPageID`, `wikiTemplateID`) VALUES
(1, 1),
(2, 1);
-- --------------------------------------------------------
--
-- Table structure for table `wiki_templateDefinitions`
--
CREATE TABLE IF NOT EXISTS `wiki_templateDefinitions` (
`wikiTemplateDefinitionID` int(11) NOT NULL AUTO_INCREMENT,
`wikiTemplateID` int(11) DEFAULT NULL,
`headingOrder` int(11) DEFAULT NULL,
`heading` text,
`description` text,
`dataType` text,
PRIMARY KEY (`wikiTemplateDefinitionID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=3 ;
--
-- Dumping data for table `wiki_templateDefinitions`
--
INSERT INTO `wiki_templateDefinitions` (`wikiTemplateDefinitionID`, `wikiTemplateID`, `headingOrder`, `heading`, `description`, `dataType`) VALUES
(1, 1, 0, 'Heading 1', 'A heading', 'text'),
(2, 1, 1, 'Heading 2', 'Another heading', 'textArea');
-- --------------------------------------------------------
--
-- Table structure for table `wiki_templates`
--
CREATE TABLE IF NOT EXISTS `wiki_templates` (
`wikiTemplateID` int(11) NOT NULL AUTO_INCREMENT,
`name` text,
`description` text,
PRIMARY KEY (`wikiTemplateID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=2 ;
--
-- Dumping data for table `wiki_templates`
--
INSERT INTO `wiki_templates` (`wikiTemplateID`, `name`, `description`) VALUES
(1, 'Generic Template', 'A generic temp-late to use as a bare wiki page');