1 wordpress and 1 regular php website in one databse

55 Views Asked by At

I have a godaddy starter hosing plan which offers only one mysql database. I already have a wordpress website installed on it. I want to install another non-wordpress php website on it which also requires a database. I want to know if it is possible for both to share one database. Both are different websites with different content and i want to use the same domain with a subdomain for the later one. please help.

2

There are 2 best solutions below

0
On

You can use the same database with both websites by adding a prefix to all the tables of one of the sites. By default, WordPress prefixes all of its tables with wp_ so as long as none of your tables for the other website start with wp_ you shouldn't need to prefix any of the new websites tables.

1
On

Yes, two sites can share a database, each with it's own tables. Definitely use a namespace on your tables to easily identify which tables belong to which app.