![]() |
|
? |
![]() PHP FAQ PHP Articles PHP Help Bulletin Board PHP Manual (NEW!) First Time PHP'ers Help with programming Sql assignment help PHP Homework Help C# Help
|
? |
|
|||||||||||||||||||||||||
?Reply To This Message | ||||||||||||||||||||||||||||
?Your Name: | ||||||||||||||||||||||||||||
?Your Email: | ||||||||||||||||||||||||||||
?Subject: | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
Email replies to this thread, to the address above. | ||||||||||||||||||||||||||||
??wrote: > > If i have a country list want to list out, like this: > > table "country" > > cou_list > --------- > USA > England > China > Japan > Korea > ...etc > > How can I list them out? > I can list them out by "while" function > but I want to put them all in an array. > > I have tried this: > > function get_country_array() > // extract old info from database > { > $conn = db_connect(); > > $query = "select cou_list from countries"; > $result = mysql_query($query); > > $col = mysql_num_rows($result); > $country_ar = array(); > > for ($i = 0; $i <=$col; $i++) { > $result[$i] = $country_ar; > } > > for ($i=0; $i <=$col; > $i++) > { > if ($country_ar[$i] == $old_country) > { > $country_select[$i] = > 'selected'; } echo ''; > } > > return $result; > } > ?> > > Can anyone teach me? > thanks ">??![]() |