Grumps Posted April 10, 2015 Share Posted April 10, 2015 I have no code yet that why I am posting this. I need a login script something like this: if user = xxx then $db_host = "localhost";$db_user = "1234";$db_pass = "*******";$db_name = "1234";$db_table = "xxx"; else if user = yyy then $db_host = "localhost";$db_user = "1234";$db_pass = "********";$db_name = "1234";$db_table = "yyy"; else if user = zzz then $db_host = "localhost";$db_user = "1234";$db_pass = "********";$db_name = "1234";$db_table = "zzz"; else user = '' then $db_host = "localhost";$db_user = "1234";$db_pass = "********";$db_name = "1234";$db_table = "casual"; Trouble is I need to connect to the database to get the user then disconnect and reconnect to it with the correct table. Also have not attempted to write the login script for the website as I think it might be all part of the same thing. Quote Link to comment https://forums.phpfreaks.com/topic/295400-user-login-if-user-xxx-then-login-to-table-xxx/ Share on other sites More sharing options...
Ch0cu3r Posted April 10, 2015 Share Posted April 10, 2015 You do not need to "disconnect and reconnect" to query a different table that is on the same server and in the same database. Quote Link to comment https://forums.phpfreaks.com/topic/295400-user-login-if-user-xxx-then-login-to-table-xxx/#findComment-1508689 Share on other sites More sharing options...
Barand Posted April 10, 2015 Share Posted April 10, 2015 You don't even need to reconnect to query another database - the connection is to the server. Quote Link to comment https://forums.phpfreaks.com/topic/295400-user-login-if-user-xxx-then-login-to-table-xxx/#findComment-1508692 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.