![]() |
lefty author 11/8/2024 |
So I guess I forgot the other Main question, since we setup a database connection in our main project. How do I overcome this problem with the second, third and so on database connection since it's new and the project obiously has the first connection. particulary dynamically. |
![]() |
Sergey Kornilov admin 11/9/2024 |
You simply need to use Dynamic Permissions based on tables located in the client's database. When you clone the database, permissions tables and permissions themselves will be cloned and your new client will be ready to go. |
![]() |
lefty author 11/13/2024 |
So that is simple enough. But to ensure on each call in the project , I will need to initialize this before each query. function initializeCompanyDatabase() { $dbname = 'database' . $_SESSION['comid']; // Construct the database name } // Call this function at the start of each page/request |
![]() |
Sergey Kornilov admin 11/14/2024 |
You need to read SaaS application design article one more time: |
![]() |
lefty author 11/14/2024 |
Okay , Thanks for the reply Had to edit this. I still don't get what the blog image ( see image 1 at top it has 5 databases listed ) What is in those databases, or are they just connections. The image is confusing me. "You can see that we have a common saasdb database here and multiple identical client databases. We only need to add to the project one of those client databases, database1 one in our example." What are the other ones ( like are they empty clones - confusing ) ? Meaning do I have to add all the databases I plan to use in the future to the project as they will be created on the fly with a webhook after purchase? What am I missing here? |
![]() |
lefty author 11/14/2024 |
I finally wrapped my head around it I believe. I clone the security settings for the Project database which you mentioned earlier. Thanks again for the replies. Edited: Yes you can , This is solved . |