Can some one help me with this database connectiong issue |
[eluser]tiffany1988[/eluser]
HI Guys Hey Guys , Im fairly new to this CI framework , i was just trying to write a code to connect to multiple database where i am really getting sick of this method . if some one has already worked on this see if you guys can help . Thank you
[eluser]tiffany1988[/eluser]
[quote author="PravinS" date="1377930148"]Check this http://ellislab.com/codeigniter/user-gui...ation.html[/quote] Hey Pravin , Thank you . I did check that page but it doesn't seem to help either. Here's what we are trying to do . we have multiple localhost servers with different IP's we are tryig to fetch the tables of that servers by selecting the server name . First you will select the server name : We fetch the server credentials using that name then we have to pass that to the database query function this is the code we are working with see if you can help me . thank you so much honey. Code: <?php
[eluser]PravinS[/eluser]
you can save the group name in database, so you last two function get_db_lst and connectDb will be like this Code: function get_db_lst($srv_cred)
[eluser]tiffany1988[/eluser]
[quote author="PravinS" date="1377934736"]you can save the group name in database, so you last two function get_db_lst and connectDb will be like this Code: function get_db_lst($srv_cred) $group = $value['pswd']; why are you storing password in that $group ?? i believe its by mistake...O.o
[eluser]PravinS[/eluser]
sorry its not password, its group name, you need to store group name in database, then u can use it $group = $value[‘group_name’];
[eluser]tiffany1988[/eluser]
Finally Found the solution !! hope this helps some more people!!! This code here is for : 1.Selecting Different databases from different localhost servers DYNAMICALLY!!!! 2. Note that the primary database.php file has to be configured with a database initially otherwise this won't work Thanks Guys!! Code: <?php |
Welcome Guest, Not a member yet? Register Sign In |