Re: Multiple 'similar' dropdowns -> 1 query
- From: Geoff Berrow <blthecat@xxxxxxxxxxx>
- Date: Wed, 27 Jul 2005 21:25:47 +0100
I noticed that Message-ID:
<1122495115.266022.14850@xxxxxxxxxxxxxxxxxxxxxxxxxxxx> from frizzle
contained the following:
>Hmm, being the newbie i am, i still can't get it to work:
>i have $result = mysql_fetch_array($get_result);
>
>Works fine with a
>
>do{
> foo
>}while($result = mysql_fetch_array($get_result));
>
>It returns the following from the DB:
>
>id code
>____________
>27 ABC becomes: <option value="27">ABC</option>
>35 KNO becomes: <option value="35">KNO</option>
>57 TRE etc.
>81 FLO etc.
>____________
>
So $result[id] ==27 $result[code]==ABC
You have to combine those into a new array
$select_array=array();
while($result = mysql_fetch_array($get_result)){
$select_array[$result[id]]=$result[code];
}
Then your new array will contain the database rows as key/value pairs
and you can use it in the function.
echo mk_select('name_1', $select_array, 'find_this');
--
Geoff Berrow (put thecat out to email)
It's only Usenet, no one dies.
My opinions, not the committee's, mine.
Simple RFDs http://www.ckdog.co.uk/rfdmaker/
.
- References:
- Multiple 'similar' dropdowns -> 1 query
- From: frizzle
- Re: Multiple 'similar' dropdowns -> 1 query
- From: Geoff Berrow
- Re: Multiple 'similar' dropdowns -> 1 query
- From: frizzle
- Re: Multiple 'similar' dropdowns -> 1 query
- From: Geoff Berrow
- Re: Multiple 'similar' dropdowns -> 1 query
- From: frizzle
- Multiple 'similar' dropdowns -> 1 query
- Prev by Date: Re: Multiple 'similar' dropdowns -> 1 query
- Next by Date: zend_list_delete undefined symbol
- Previous by thread: Re: Multiple 'similar' dropdowns -> 1 query
- Next by thread: Problem with gzuncompress
- Index(es):
Relevant Pages
|