I have an array like this in my config file,
$db["default"]["hostname"] = "localhost"; $db["default"]["username"] = "root"; $db["default"]["password"] = "pass"; $db["default"]["database"] = "db";but here is the thing, I want to be able to "save" different "connections". So for example, I could have like this,
$db["development"]["hostname"] = "localhost"; $db["development"]["username"] = "root"; $db["development"]["password"] = "pass"; $db["development"]["database"] = "devDB"; $db["production"]["hostname"] = "localhost"; $db["production"]["username"] = "root"; $db["production"]["password"] = "pass"; $db["production"]["database"] = "proDB";And then I have this line,
$config["conRoute"] = "default";in my config file too.
So basically I can choose different connections but I can set up multiple in the config file and just change the route variable if I wanna use another connection. I've already fixed it so it throws an error when the conRoute variable is empty but how would I check if the conRoute value is a db variable?
So with the example above, if the conRoute is "development" or "production" then it would be valid but if it was "online" then it would be invalid because that setup doesn't exist. How would I do this?