PHPRad Classic Initial 2.7.3 Forum

PHPRad Forum => Questions => Topic started by: packetloss69 on September 10, 2020, 06:32:34 AM

Title: Use multiple Databases
Post by: packetloss69 on September 10, 2020, 06:32:34 AM
Hi. How do i access multiple databases from PHPRad?
Apologies if this has been answered before.

I am currently resorting to using MariaDB CONNECT engine in order to centralize tables into 1 dB.
Clearly there is probably a better way.

Getting results form diffrent DB's is important for our use case in order to render graphs etc..
Any basic examples of how to integrate?

Thank you for your time.
Title: Re: Use multiple Databases
Post by: willvin on September 10, 2020, 09:26:08 AM
@packetloss69‍ currently phprad only supports connecting to one database for a project. If you would want your project to connect to several databases you will have to write the code to handle that aspect yourself.
Title: Re: Use multiple Databases
Post by: murugappan on September 14, 2020, 12:45:55 PM
Hi Willvin,

We understand the limitation of this software. My need is this.

(1) I want to display a list from a table in a SQLSRV database.
(2) When i select a row in the list, i want to display the details of the row on another page and also display a list of rows from table in MySQL database

Allow me to give you a summary example:
(1) Doctor accesses the list of patient appointments (in SQLSRV)
(2) The details of the appointment are show in another page
(3) Below the details, list of medical visits (from MySQL Database) are then shown.

I this possible in PHPRad? Something gives me the feeling that this has to be done completely in custom code.
Title: Re: Use multiple Databases
Post by: willvin on September 14, 2020, 02:07:54 PM
@murugappan‍ you can use the page component in page design to achieve what you want, by adding the medical visits list page as a subpage to the appointment details page.
Title: Re: Use multiple Databases
Post by: murugappan on September 23, 2020, 02:13:37 PM
@willvin what you saying is i can do this:

(1) Add main page for the detail
(2) then add a subpage for the list under the main page.

if that the is true, i see what you mean and i will try that. Still one question remains. Where do i add the code to connect to another database and how to do i get the details to the view, add, update and  delete pages.

I would be great if you could add a sample tutorial in YouTube showing this. I am sure many subscribers to PHPRad would like to know as well.