| | |
How to connection string into a dictionary in php code and vice versa
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Oct 2008
Posts: 18
Reputation:
Solved Threads: 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.
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.
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:
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)
$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.
★ "If your not having fun, your doing something wrong." - Humbug
★ Did I help you out? Did I piss you off? Add to my reputation!
★ The Gabriel Method is a great book for losing weight and keeping healthy - I know Jon Gabriel Personally.
★ Did I help you out? Did I piss you off? Add to my reputation!
★ The Gabriel Method is a great book for losing weight and keeping healthy - I know Jon Gabriel Personally.
![]() |
Other Threads in the PHP Forum
- Previous Thread: tab control in html and php
- Next Thread: PHP to Java script
| Thread Tools | Search this Thread |
301 access apache api array beginner binary broken button cakephp checkbox class clean cms code countingeverycharactersfromastring crack cron curl database date decode directory display dissertation dropdown dynamic echo email error fairness file files folder form forms function functions google href htaccess html image include insert integration ip javascript joomla limit link login mail match md5 menu methods mlm multiple mysql newsletters oop pageing pagerank paypal pdf php problem protocol query radio random recursion remote script search secure server sessions simple sms soap source space spam sql syntax system table tutorial update upload url validator variable video virus votedown web youtube





