Jump to content

Archived

This topic is now archived and is closed to further replies.

Grumps

user login - if user =xxx then login to table xxx

Recommended Posts

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.

Share this post


Link to post
Share on other sites

You do not need to "disconnect and reconnect" to query a different table that is on the same server and in the same database.

Share this post


Link to post
Share on other sites

You don't even need to reconnect to query another database - the connection is to the server.

Share this post


Link to post
Share on other sites

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.