How to choose the database in login

-1

I'm developing a business management website, and for each company I'm going to make a separate database so there is no delay but queries and also that one company does not see the data of another company, the question is how do I make this selection Which bank to connect at the time of login? I'm using Mysql, Xampp ...

att

Alexandre

    
asked by anonymous 09.09.2018 / 03:21

2 answers

0

If you are using a simple connection using the php classes for mysql, then use the function below:

  • Function: mysql_select_db ();
  • Link: link

However the functions of mysql have been discontinued, the recommendation is to use the "mysqli" of php, since it will not use the PDO. With it you already define the database that you want to use in the connection itself: link

I hope I have helped.

    
09.09.2018 / 15:00
0

Personally solved, I created a master bank that contains the company data and tbm, the respective bank name of each one, when I log in I call the name of the bank and add it in $ _SESSION [], then in the connection variable mysqli_connect (), thank you all.

    
10.09.2018 / 14:14