Very nice.  Works great.  Thank you very much James.  :-)

John

--- In php-list@yahoogroups.com, James Keeline <[EMAIL PROTECTED]> wrote:
 
> Instead of iterating through each number from 1 to the maximum
number of rows,
> why not use a while() loop.
> 
> 
> while ($row_data = mysql_fetch_assoc($result))
> {
>  $vendname = trim($row_data['vendname']);
>  # check to see if the value is not empty
>  if ($vendname)
>  {
>   printf("<option value=\"%s\">%s</option>", $vendname, $vendname); 
>  }
> }
> 
> 
> Also, if you want your vendor names to be unique and alphabetical
(perhaps you
> don't) you can change your query to:
> 
> SELECT vendname FROM $table GROUP BY vendname
> 
> This will select unique values from the vendname column and then
sort them
> alphabetically.
> 
> James
>


Reply via email to