i cant get it to output
Posted: Fri Sep 18, 2009 7:36 am
Im trying to run a simple if command and this doesnt seem to work im trying to get it to hiighlight the option already selected in the db any ideas why?
function selected()
{
global $selectedno;
//for loop to loop through 10
$a = 11;
for ($i = 0; $i <10; $i++)
{
$a = --$a;
$num = $a;
if ($selectedno == $num)
{
$bash = ' selected="selected"';
}
echo '<option value="' . $a . '"' . $bash . '>' . $a . ' ' . $selectedno . ' </option>';
}
}
function selected()
{
global $selectedno;
//for loop to loop through 10
$a = 11;
for ($i = 0; $i <10; $i++)
{
$a = --$a;
$num = $a;
if ($selectedno == $num)
{
$bash = ' selected="selected"';
}
echo '<option value="' . $a . '"' . $bash . '>' . $a . ' ' . $selectedno . ' </option>';
}
}