Hello all,

I have an order form where I am trying to load an option button with a
field column from a database file:

This part works fine (actually Professional PHP has an example using the
do...while statement - I wonder which is better?):

$len = mysql_num_rows($result); 
for ($i=0; $i<=$len; $i++) {
  echo "<option value=\"$catid[$i]\">$catid</option>";
}  

The problem I have is loading the array - either I get the first or last
element of the array as a scalar variable or I get arrays of the word
'Array':

       while ($row = mysql_fetch_array($result)) {
         $rowid[] = $row["dnaProd_ID"];
         $catid[] = $row["Cat_ID"];
         $desc[] = $row["Description"];
         $size[] = $row["Pkg_size"];
         $price[] = $row["Price"];
       }                                     
and I have tried it without the [] - neither works.  I also tried this
with a for loop - replacing the while statement with 
   for($j=0; $j<=$len; $j++) {
   $row = mysql_fetch_array($result); 
   $rowid[$j] = $row["dnaProd_ID"];
   $catid[$j] = $row["Cat_ID"];  etc, etc....

nope ;{ <sigh> - checked the archives, books - saw a similar question
but I tried what they did and it did not work. This is one of those
instances where the solution is so simple I can't find it.

TIA for your help,

Nicole               
-- 
########################
Nicole Lallande
[EMAIL PROTECTED]
760.753.6766
########################

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to