0

hai i am sathiya,
i had confussion about this program...................
please give suitable solution for this program............

a. Write a php function to accept server, database name, Username Password and create a Database connection string of the
"server=myserver;dbname=mydbname;username=myuser;passwd=mypasswd"

b. Write a function to convert the connection string into a dictionary

c. Write a function convert the connection dictionary into connection string.

2
Contributors
1
Reply
2
Views
8 Years
Discussion Span
Last Post by humbug
0

Wow, that's kind of confusing. What do you mean by a dictionary?

No one here will write your code for you but we will point you in the right direction.

Here is a good place to start (you'll want to make sure you look at the "POST & GET" section).

As for connecting the info together when you have it, it's as simple as:

$connected_string = "server=$myserver;dbname=$mydbname;username=$myuser;passwd=$mypasswd";
//or alternatively:
$connected_string = 'server='.$myserver.';dbname='.$mydbname.';username='.$myuser.';passwd='.$mypasswd;
//where the info you want is held in the variables $myserver, $mydbname, etc.
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.