what do you mean no? explain pleaselol, no?
wp_post is the only table that is different, while every other table is theoretically the same.wp_posts will affect a particular post inside that table. Interdependent, because these tables each run parallel at times to display different parts of a WordPress post or page.wp_posts saves the content part of your posts, it has an extension table wp_postmeta which stores the meta-information of their corresponding posts. Going forward, wp_terms stores the category of these posts and pages. Furthermore, wp_terms_taxonomy goes ahead and stores the taxonomy - if it is a category, tag or link. Moving ahead, wp_terms_relationships is the one that stores the information of which term is associated with which post (your post is under which category, which tag is applied to the post etc.) So on and so forth...wp_posts isn't the only shared category.wp_ before the table name? That is called a database prefix. WordPress lets you choose one when installing and lets you edit them later.wp-config.php like this$table_prefix = 'site1_';
site1_, site2.com with the prefix site2_, so on and so forth - all connecting to the same MySQL database with the same credentials.people who ask this question are not knowledgeable enough about databases and, at some point, they will mess something up and if your DB is screwed and you can't fix it then all of your sites are screwed. That's why it's always recommended to keep every site and every program that you install on its own DB.what do you mean no? explain please
Let me explain what i did: First of all i truncate the wp-post and wp-postmeta and then i get the contents with an automated bot and then i edit the contents and then i export the full database so i export all 12 databases that you talked about above, after i export the database file i again truncate the wp_post and wp_postmeta and then i do the same for my other website projects. im preparing websites like this, i will launch my websites later. Can't I use the same database for all of my different websites?Let me explain why that is not the case -
Let me explain what i did: First of all i truncate the wp-post and wp-postmeta and then i get the contents with an automated bot and then i edit the contents and then i export the full database so i export all 12 databases that you talked about above, after i export the database file i again truncate the wp_post and wp_postmeta and then i do the same for my other website projects. im preparing websites like this, i will launch my websites later. Can't I use the same database for all of my different websites?
This should be a post of its ownYou haven't mentioned the script you're using. So for all intents and purposes, I am going to assume that it is WordPress and my answer will be framed accordingly.
So, you want to use the same database for different websites. You believe thatwp_postis the only table that is different, while every other table is theoretically the same.
Let me explain why that is not the case -
So a core WordPress installation is built out of 12 tables, these are
You can read about them here - https://codex.wordpress.org/Database_Description
- wp_posts
- wp_postmeta
- wp_options
- wp_users
- wp_usermeta
- wp_term_taxonomy
- wp_terms
- wp_termmeta
- wp_term_relationships
- wp_links
- wp_comments
- wp_commentmeta
Now all of these tables are both independent and interdependent at the same time. Independent, in that editing the content of one specific table (for instancewp_postswill affect a particular post inside that table. Interdependent, because these tables each run parallel at times to display different parts of a WordPress post or page.
Now, for instance,wp_postssaves the content part of your posts, it has an extension tablewp_postmetawhich stores the meta-information of their corresponding posts. Going forward,wp_termsstores the category of these posts and pages. Furthermore,wp_terms_taxonomygoes ahead and stores the taxonomy - if it is a category, tag or link. Moving ahead,wp_terms_relationshipsis the one that stores the information of which term is associated with which post (your post is under which category, which tag is applied to the post etc.) So on and so forth...
This should help you understand thatwp_postsisn't the only shared category.
Now, if your sites are relatively new, have little content no traffic and you want each of them to connect to a single database (maybe you have limited databases etc.) - what you can do is edit the database prefixes.
See thewp_before the table name? That is called a database prefix. WordPress lets you choose one when installing and lets you edit them later.
You can also declare them in yourwp-config.phplike this
PHP:$table_prefix = 'site1_';
So theoretically, you can have site1.com with the prefixsite1_, site2.com with the prefixsite2_, so on and so forth - all connecting to the same MySQL database with the same credentials.
This is, however, not recommended.
We do this in our test environments when testing websites or running a quick fix on errors and we can't be bothered to create a new environment.