Jump to:

23377 Posts in 18296 Topics by 2867 members

General Questions

SilverStripe Forums » General Questions » Problem with SS 2.3 add class

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 283 Views
  • anackiy.aleksandr
    Avatar
    Community Member
    3 Posts

    Problem with SS 2.3 add class Link to this post

    Hi! Sorry for my English) I want create new page type.
    This is my code
    <?php

    class VitrinaHolder extends Page {
    static $db = array(
    "Phone" => "Varchar(200)"
    );
    static $has_one = array(
    );

    function getCMSFields() {
    $fields = parent::getCMSFields();
    $fields->addFieldToTab('Root.Content.Main', new TextField("Phone", "Phone"), "Content");
    return $fields;
    }
    }

    class VitrinaHolder_Controller extends Page_Controller {
    public function init() {
    parent::init();
    }
    }

    ?>

    I get an error

    [User Error] Couldn't run query: CREATE TABLE `VitrinaHolder` ( `ID` int(11) not null auto_increment, `Phone` varchar(200) character set utf8 collate utf8_general_ci, primary key (ID) ) TYPE=MyISAM 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 'TYPE=MyISAM' at line 7
    GET /dev/build?flush=1

    Line 401 in /home/webzabota/data/www/anackiy.webzabota.com/sapphire/core/model/MySQLDatabase.php

    As far as I understand it, the code - is correct. What is the cause of the error? Someone tell me what's the problem?

    Attached Files
    283 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.