17488 Posts in 4473 Topics by 1978 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 1200 Views |
-
2 Databases

17 July 2008 at 10:34pm
Hello,
I'm wanting to use SS for a client. This client has a huge database of products (will set up another mysql database with all the products descriptions links to images ect). What I was wanting to know what would be the easiest way to connect the 2 databases togeather for example if the client updates the information on page "pens" it will send the data from the SS database and into my custom database.
Sorry if this is confusing I wrote it how I thought o
-
Re: 2 Databases

18 July 2008 at 3:03pm
You could write an API to connect the two, but that would be a lot of work.
Or, you could make custom DB::query() calls and convert them into a DataObjectSet containing ArrayData objects. Here's a quick example of you could do that.
$output = new DataObjectSet();
foreach(DB::query("SELECT * FROM OtherDB.Table") as $record) {
$output->push(new ArrayData($record));
}$output could then be rendered into SilverStripe templates.
| 1200 Views | ||
|
Page:
1
|
Go to Top |



