1

I couldn't find anything on Google or on here about best practice for data that is not really Wordpress related.

Say we have a database of clients that we'll be accessing through PHP/SQL. Should I just create new tables within the wordpress database or is it good practice to keep these in completely separate databases?

Currently its very basic and was actually being done as an external CSV. Moving forward though we want it to be a database and eventually clients will have a login area as well.

  • 1
    I mean, I wouldn't give it an entirely own database unless you're going to have tons of tables. If it's just 1 or 2 tables worth of data, just put it into the same database as your WP install. – Howdy_McGee Jul 2 '15 at 16:30
  • It's easier to use tables in current database because possible migraing problems (It depends on your project) This link is an article on how create table in current WordPress DataBase: kylejlarson.com/blog/2013/… – Amirmasoud Jul 2 '15 at 18:16
2

WordPress uses a prefix by default just in case the database is being used by more than WordPress. Since creating a new DB is pretty simple I would go that route. You would get the potential benefit of it being something separate that you can easily export, import or blow away if needed and also the potential security benefit if your WP site gets hacked this DB is separate (and vice-versa).

If you do decide to use the same DB then you should prefix your tables to make them easier to know what they are used for.

2

If you're going to keep using that database for other things as well, keep it separate. But from what you're saying, you are rather trying to expand functionality for it within the site, so better integrated. There are a lot of things you can do with a database even from within WP anyway.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.