views:

457

answers:

6

I am building a personal site, for blog i wish to use wordpress and for a wiki i will use wikia. Is it possible that i use the same database for storing articles from both the frontends (wordpress and wiki). If yes can i some how populate articles from my wiki to the blog, under a specific category.

EDIT-- By two different sites I mean two different frontends, hosted at different subdomains.

+1  A: 

Why not, its possible, just take care from any tables names conflict between both tables, you may need to edit some tables names.

And about populating one from another, i think you will need to edit its code some how to let it understand the new tables.

Amr ElGarhy
+1  A: 

A host will put multiple clients on the same database server, so yes.

If you control the database and the apps, then you could code them to "share info"

KM
A: 

I'm not really sure what your aim is. Is your intention simply to share data between Wordpress and Wikia?

You should not store two unrelated schemas in one database. It's just asking for collisions. Both Wikia and Wordpress maintain their own schemas: they may name different functional database objects the same.

If you want to share data between the two databases, you can set up triggers and views to move data from one to the other without them being in the same database.

Welbog
Wikka and WordPress allow table/object prefixes to prevent collisions. Works perfectly well.
Kev
A: 

The short answer is YES.

However, you will need to watch out for database object naming conflicts.

Also, when you say 'two different sites' do you mean 2 different sites? Or just different 'frontends' within the same site? If it just different front apps running in the same website, then you will also have to make sure you won't have any configuration conflicts.

John MacIntyre
I mean two different frontends, hosted at different subdomains.
Vivek Sharma
+1  A: 

They can quite happily use the same database. Depending on the RDBMS you are using, you may want to create an additional Database or user instance for each site.

With SQL Server you can create an additional database, or you can add a schema for each site. for Oracle you can create a user specific to each site.

To return data from one place to another, simply build a view which is accessible to each schema. You will need to set privileges on the source database to do this, but that's pretty straightforward.

Hooloovoo
Based on the tools he's asking about, he's more likely to be using MySQL.
John MacIntyre
@John - Yes you are right, Wordpress and WikkaWiki they both use MySQL.
Vivek Sharma
+1  A: 

At installation time, both WordPress and Wikka allow you to prefix their tables with different names to prevent naming collisions. So yes it is possible to allow both applications to share the same database.

We have plenty of customers on our shared hosting environment who do this without any issues.

In answer to your second question, you may be in for a bit of custom code to do that.

Kev