On Sunday 09 June 2002 17:27, electroteque wrote:
> hi i am populating a list menu with mysql , i would like to find a way to
> populate a form with more than one of the same list menus in a for loop
>
>  <select name="type[]">
>        <?
>        while ($sample = $result->fetchRow(DB_FETCHMODE_ASSOC)) {
>        $typeID=$sample["typeID"];
>        $description=$sample["description"];
>     $sample_type[$sample['typeID']] = $sample["description"];
>     echo "\n<option value=\"$typeID\" $selected>$description</option>";
>     }
>     ?>
>     </select>
>
> i have this within a for loop but the list only shows up once and the
> second one is empty because the select from the database is finished ,
>
> is there a way to put the information from mysql into arrays so i can use
> it more than once and then i could do multiple populated list boxes ? let
> me know

use mysql_data_seek() to reset the row pointer.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
QOTD:
        "She's about as smart as bait."
*/


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to