You are here: Re: select box « All PHP « IT news, forums, messages
Re: select box

Posted by Geoff Berrow on 01/11/07 15:11

Message-ID: <g6kcq211hinohaqm5kls2qve4ki50duab6@4ax.com> from Peter
revera contained the following:

>$get = "SELECT * FROM categories";
>$answer = mysql_query($get)
>or die ("Couldn't execute query.");
>
> echo "<select name=listid' class='gradientform'>\n";
> while ($row = mysql_fetch_array($answer))
> {
> extract($row);
> echo "<option value='$itemid'>$item\n";
> }
> echo "</select>\n";

$get = "SELECT * FROM categories";
$answer = mysql_query($get)
or die ("Couldn't execute query.");

echo "<select name=listid' class='gradientform'>\n";
while ($row = mysql_fetch_array($answer))
{
extract($row);

$selected=(isset($_GET['listid']) &&$_GET['listid']==$itemid)?"
selected":"";
echo "<option value='$itemid'$selected>$item</option>\n";
}
echo "</select>\n";

--
Geoff Berrow 0110001001101100010000000110
001101101011011001000110111101100111001011
100110001101101111001011100111010101101011

 

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

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