[英]How Can I Connect Each User To His Own Database?
I have created a Cataloguer using php/mysql. 我使用php / mysql创建了一个Cataloguer。 This Cataloguer will be distributed for some people (about 20+).
该目录将分发给一些人(约20+)。 All of them will have a specific database with there own cataloguer.
所有这些都将拥有一个具有自己的编目器的特定数据库。 Those database will be created by the ADM.
这些数据库将由ADM创建。 But how can I redirect a user to his own database?
但是,如何将用户重定向到自己的数据库?
Right now the only thing I know about alternating from one database to another is by my dbh.php file: 现在我唯一知道从一个数据库到另一个数据库交替的是我的dbh.php文件:
<?php
$dbServername = "localhost";
$dbUsername = "root";
$dbPassword = "";
$dbName = "user1";
$conn = mysqli_connect($dbServername, $dbUsername, $dbPassword, $dbName);
I have a login page wich its link I will send to these people. 我有一个登录页面,我将发送给这些人的链接。 In that login page I want to make it so they fill in a key (each person has its specific key) that redirects them to a website (the cataloguer) and that cataloguer will use the database of that specific key only.
在该登录页面中,我想要这样做,以便他们填写一个密钥(每个人都有其特定的密钥),将它们重定向到一个网站(编目员),并且该编目员将仅使用该特定密钥的数据库。
If you know of any tutorial on that please send me! 如果你知道任何教程,请发给我!
Create a database for the users themselves and in it store the name and credentials for each user's own database. 为用户自己创建一个数据库,并在其中存储每个用户自己的数据库的名称和凭据。 Once you log the user in then simply connect to the specific user's database.
登录用户后,只需连接到特定用户的数据库即可。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.