943,696 Members | Top Members by Rank

Ad:
  • PHP Discussion Thread
  • Unsolved
  • Views: 550
  • PHP RSS
Oct 31st, 2008
0

How to connection string into a dictionary in php code and vice versa

Expand Post »
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.
Reputation Points: 9
Solved Threads: 0
Newbie Poster
r_sathya is offline Offline
18 posts
since Oct 2008
Oct 31st, 2008
0

Re: How to connection string into a dictionary in php code and vice versa

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:
php Syntax (Toggle Plain Text)
  1. $connected_string = "server=$myserver;dbname=$mydbname;username=$myuser;passwd=$mypasswd";
  2. //or alternatively:
  3. $connected_string = 'server='.$myserver.';dbname='.$mydbname.';username='.$myuser.';passwd='.$mypasswd;
  4. //where the info you want is held in the variables $myserver, $mydbname, etc.
Reputation Points: 20
Solved Threads: 13
Junior Poster in Training
humbug is offline Offline
93 posts
since Oct 2005

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in PHP Forum Timeline: tab control in html and php
Next Thread in PHP Forum Timeline: PHP to Java script





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC