XML Error - mysqlt error: 1064

Permalink
Hey, I'm down on my knees asking for a helping hand here :)

I am not a back-end developer but a front-end, anyhow. I'm trying to create a custom block which is going well, BUT I am constantly getting error on the db.xml, which is driving me crazy!!!

mysqlt error: [1064: 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 ' crLayoutStsClas VARCHAR, crColStsOneClas VARCHAR, crColStsOne' at line 3] in EXECUTE("CREATE TABLE btColRespond ( bID INTEGER UNSIGNED NOT NULL, crLayoutStsNum VARCHAR, crLayoutStsClas VARCHAR, crColStsOneClas VARCHAR, crColStsOneVis INTEGER, crColStsOneWid VARCHAR, crColStsOnePad VARCHAR, crColStsOneHeading VARCHAR, crColStsOneTag VARCHAR, crColStsOneUrl VARCHAR, crColStsOneIco VARCHAR, crColStsOneCol VARCHAR, crColStsOneColHov VARCHAR, crColStsTwoClas VARCHAR, crColStsTwoVis INTEGER, crColStsTwoWid VARCHAR, crColStsTwoPad VARCHAR, crColStsTwoHeading VARCHAR, crColStsTwoTag VARCHAR, crColStsTwoUrl VARCHAR, crColStsTwoImg VARCHAR, crColStsTwoCol VARCHAR, crColStsTwoColHov VARCHAR, crColStsThreeClas VARCHAR, crColStsThreeVis INTEGER, crColStsThreeWid VARCHAR, crColStsThreePadd VARCHAR, crColStsThreeHeading VARCHAR, crColStsThreeTag VARCHAR, crColStsThreeUrl VARCHAR, crColStsThreeImg VARCHAR, crColStsThreeCol VARCHAR, crColStsThreeColHov VARCHAR, crColStsFourClas VARCHAR, crColStsFourVis INTEGER, crColStsFourWid VARCHAR, crColStsFourPad VARCHAR, crColStsFourHeading VARCHAR, crColStsFourTag VARCHAR, crColStsFourUrl VARCHAR, crColStsFourImg VARCHAR, crColStsFourCol VARCHAR, crColStsFourColHov VARCHAR, crColStsFiveClas VARCHAR, crColStsFiveVis INTEGER, crColStsFiveWid VARCHAR, crColStsFivePad VARCHAR, crColStsFiveHeading VARCHAR, crColStsFiveTag VARCHAR, crColStsFiveUrl VARCHAR, crColStsFiveImg VARCHAR, crColStsFiveCol VARCHAR, crColStsFiveColHov VARCHAR, PRIMARY KEY (bID) )")


I've gone through it a number of times, put it through validators, checked for SQL reserved words, scanned for invisible characters, but still no success :(

Can someone possibly / please check over the attached XML (txt) as I'm starting to pull my hair out and feel I'm going around in circles.

Development environment details below;
- Apache 2.2.26 (Unix)
- PHP 5.4.24
- MySQL 5.6.14
- PHPMyAdmin 4.0.9
- Concrete5 5.6.2.1


MASSIVE thank you in advance!!

1 Attachment

ChrisWatterston
 
JohntheFish replied on at Permalink Best Answer Reply
JohntheFish
'C' fields are need to have a size.

eg
<field name="whatever" type="C" size="16">


The size needs to be big enough for the data string that is entered.

Looking at your field names, maybe some of them would be better implemented as integers, in which case you will need to make sure they really are integers in your block controller validate/.save methods.

The easiest way to get started with one-off blocks is to use the Designer Content addon to create the basic code, then edit what it generates for you.
JohntheFish replied on at Permalink Reply
JohntheFish
A purist may comment that repeated structures like you have in your data are better implemented as a second table. Unless you are developing an addon package for the marketplace, a single table like you have is good enough and simpler.

You may also find these howtos of use:
http://www.concrete5.org/documentation/how-tos/developers/save-and-...
http://www.concrete5.org/documentation/how-tos/developers/creating-...
ChrisWatterston replied on at Permalink Reply
ChrisWatterston
Hey John,
Thanks for the advice and helping hand!
Chris