You are here: Re: Putting database output in <option> field - how? « PHP SQL « IT news, forums, messages
Re: Putting database output in <option> field - how?

Posted by peter on 06/11/07 21:35

> Try this:
>
> <SELECT NAME=\"country\">
> <OPTION SELECTED='selected'>$Row[country]</OPTION>
> <option>Afghanistan</option>
> <option>Aland Islands</option>
> <option>Albania</option>
> <option>etc etc </option>
> </select>

I think he actually means how does he populate the list of countries from a
list in the db.

To do this you need to loop through the results. Something like:-

echo "<SELECT NAME=\"country\">"
while ($row = mysql_fetch_array($db))
{
echo "<OPTION>$row[0]</OPTION>"
}
echo "</select>"

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация