?

Search Help Board

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

?
?Re: How to put whole colume in an array?
Author:??(---.cpe.net.cable.roger)
Date:???10-15-03 06:48

function get_country_array()
// extract old info from database
{
$conn = db_connect();

$query = "select cou_list from countries";
$result = mysql_query($query);

//build the array from the results
while ($rows = mysql_num_rows($result)){
$country_ar[] = $rows['cou_list'];
}



//build the select box
$num_rec=count($country_ar);
for ($i = 0; $i <=$num_rec; $i++) {
if ($country_ar[$i] == $old_country){
//echo out the old country as selected
echo "

?Topics Author? Date
?How to put whole colume in an array???new
Vincent 10-14-03 16:51?
?how to retrieve address in variable using array???new
jan 10-14-03 20:25?
?Re: How to put whole colume in an array???new
bastien 10-15-03 06:48?
Go to Top??|??Go to Topic??|??Flat View??|??Search?
??|??
New Topic
?Reply To This Message
?Your Name:
?Your Email:
?Subject:
Email replies to this thread, to the address above.
??wrote: > > function get_country_array() > // extract old info from database > { > $conn = db_connect(); > > $query = "select cou_list from countries"; > $result = mysql_query($query); > > //build the array from the results > while ($rows = mysql_num_rows($result)){ > $country_ar[] = $rows['cou_list']; > } > > > > //build the select box > $num_rec=count($country_ar); > for ($i = 0; $i <=$num_rec; $i++) { > if ($country_ar[$i] == $old_country){ > //echo out the old country as selected > echo "

Provided By
Phorum