| | |
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 |
Tag cloud for PHP
.htaccess access ajax apache api array beginner binary broken cakephp checkbox class cms code codingproblem cron curl database date directory display download dynamic echo email error file files folder form forms function functions google href htaccess html image include insert integration ip java javascript joomla limit link login loop mail memmory menu methods mlm mod_rewrite multiple mysql oop parse paypal pdf php problem query radio random recursion regex remote script search select send server sessions sms snippet soap source space speed sql static structure syntax system table tutorial up-to-date update upload url validation validator variable video web wordpress xml youtube





