Hi evryone, just wanna ask if anyone of you could help me with my database problem. My problem is that I have 2 databases and I would like to sync them together, not combined them into 1 database but I just wanna access those 2 databases in one site, and I don't have any idea how.
e.g. my elgg database is "myelgg_db" den I have another one say "my_db", "my_db" is already an existing database for sometime now and the "myelgg_db" is just new.Then I copy some users from my "my_db" to my "myelgg_db" synchornizing them through "my_db.user.userid" and "myelgg_db.users_entity.guid" . Then I have a table "scores" in "my_db", I kinda would like to have them appear in my elgg site, so I have to query "my_db.scores" table in elgg. how do i do tha in elggt?
databasename: my_db
table1: user (userid, name, address,...)
table2: score (userid, score, daterated)
databasename: myelgg_db
table1: user_entity (guid,name, username)
info@elgg.org
Security issues should be reported to security@elgg.org!
©2014 the Elgg Foundation
Elgg is a registered trademark of Thematic Networks.
Cover image by Raül Utrera is used under Creative Commons license.
Icons by Flaticon and FontAwesome.
- Brett@brett.profitt

Brett - 0 likes
- prezy@pvmahandog

prezy - 0 likes
- Brett@brett.profitt

Brett - 0 likes
- prezy@pvmahandog

prezy - 0 likes
You must log in to post replies.This will be a bit messy, but can be done. You'll need to open another connection to mysql, select your other database, and then perform queries against that resource instead of Elgg's default connection's resource. It'll be a lot of custom code.
Hi brett, where do I exactly include my new custom code, to be able to pull data from "my_db"? Do I have to include it in /engine/settings.php or do I have to create a separete file to access that database?
You'll need to create a new plugin to do this. Probably a good time to read up on Elgg development basics and how to write plugins.
ok thanks a lot brett.