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.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Data Model Questions /

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

Importing and creating Database/tables


Go to End


2 Posts   1718 Views

Avatar
jamesvilla

Community Member, 1 Post

25 November 2013 at 4:35am

Edited: 25/11/2013 4:37am

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

Forum Moderator, 5523 Posts

28 November 2013 at 10:48pm

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.