Jump to content

Using separate connection strings for certain functions


chopps

Recommended Posts

I am trying to create an application that uses three separate database users for their connection strings.

 

One for the public site, one for logged in users, and one for the administrative users.  The logic behind this is that limited permissions would be give to the public user for the mysql database, more permissions to the logged in users, and full control to the admins.  Hopefully this would limit the damage incurred if a sql injection was to be pulled off successfully and since it uses a particular user it would help isolate the injection point.  However, I am having some trouble putting this into action and wanted to know if anyone here had any suggestions for me or reasons why this shouldn't be done.

 

The way I see it I just need three separate config files to specify the different usernames and passwords but I'm not sure what the best way to integrate this into the code.  Could I just used some nested if...else statements or would it be best to use the switch case?  Any suggestions or insight into this matter would be much appreciated.

Archived

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

×
×
  • 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.