Well, that is a loaded question… Let’s see if I can explain…
First, you create a database, usually named for your website.
Next, you create tables that pertain to different types of data to be stored into each of them.
( Such as users table, chat-posts table, etc. )
Then, in the pages on your website, you create PHP code that accesses MySQL or other database libraries to handle the CRUD of the data. CRUD is a term meaning Create/Read/Update/Delete data.
These tables are used only when needed and therefore should be separate tables. You only need to access the user’s table when a new user registers, changes their profile info or logs into your site.
There is no need to access the chat posts table when a user is editing their profile page.
Make sense? Once it awhile, you will need to combine table data into one list and you do that using the JOIN functions in the database language. This lets you combine data as needed into a bigger picture when you need fields from more than one table.
Lastly, you make a connection to the table once per web page. You select data from a table or many tables using your queries. The tables are all at hand in the one database and therefore are all connected once you connect to the database itself.
Hope that helps get you started understanding this.