Computer Forums

Member Login

Remember Me? Sign Up! | Forgot Password
 
Slogan
 
Computer Forums > The World Wide Web > Web Graphics, Design, Digital Images » PHP Mysql Select all of 1 Column, name variables with another column
Closed Thread
Old 08-26-2005, 06:26 PM   #1 (permalink)
 
Newb Techie

Join Date: Aug 2005

Posts: 2

lemonshindig

Default PHP Mysql Select all of 1 Column, name variables with another column

I know how to use php's mysql functions to retrive 1 row of coding, but how would I go about making an array with the array's variable names coming from one column, and the array's variable values coming from another, correspondingly?

Thanks!
lemonshindig is offline  
Old 08-28-2005, 02:34 PM   #2 (permalink)
 
Newb Techie

Join Date: Aug 2005

Posts: 2

lemonshindig

Default

Well... I think I figured out the solution to my problem.

while ($currentrow=mysql_fetch_array($result)) {
$flags[$currentrow['country']] = $currentrow['flag'];
}


I think that will work... but i haven't been able to test it yet, because i'm having trouble logging into the database.

Thanks
lemonshindig is offline  
 
Closed Thread

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On