|
Posted by Toby Inkster on 07/07/06 07:02
Jonathan N. Little wrote:
> Two things. One, you did not quote, tsk-tsk. Two, you missed everyone's
> point, a SELECT element with *no* OPTIONS is invalid and makes no sense.
> If that situation occurs you should not create the SELECT but instead
> some indication that no options exist...
My favourite way of doing this (in PHP) is:
<?php
$started = FALSE;
while ($data = pg_fetch_array($results))
{
if (!$started)
{
print "<select blah blah blah>\n";
$started = TRUE;
}
printf("\t<option>%s</option>\n", htmlentities($data['option']));
}
if ($started)
print "</select>\n";
unset($started);
?>
--
Toby A Inkster BSc (Hons) ARCS
Contact Me ~ http://tobyinkster.co.uk/contact
Navigation:
[Reply to this message]
|