Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

Data Model Questions

Importing and creating Database/tables


Reply

2 Posts   354 Views

Avatar
jamesvilla

25 November 2013 at 4:35am (Last edited: 25 November 2013 4:37am), Community Member, 1 Post

Hello, I'm trying to import some tables already created by Phpmyadmin and also the content of the tables but I don't know how to do that. Tutorials couldn't help me to understand everything.

AS far as I know, if I add the next code in /mysite/code/Station.php, it should create automatically a Database when running /dev/build?flush=1, but it stops at some point while its creating the tables

<?php

class Project extends DataObject{

private static $db = array(
"ame_station" => "Varchar",
"changue_stations" => "Varchar",
"distance" => "Varchar"
);
}

?>
Why is it not working?
I just started with silverstripe... And I would like to know which options I have to import those tables, maybe first I have create the properly classes and then make SQL sentences to Insert into the tables(?),. If u don't mind please, make simple explanations becouse I'm quite lost. Thank you so much.

Avatar
Willr

28 November 2013 at 10:48pm Forum Moderator, 5511 Posts

You should get an error message to your page which explains what's wrong. If you don't get an error message, make sure you're in dev mode.