...

View Full Version : select options in php



bamboli
06-21-2010, 07:02 AM
working this code..i didn't get schemeid when selecting the listbox items..pls help
<select name="lstscheme">
<?php
print '<option value="">--Select--</option>';
while(count($Result)>$i)
{
$SchemeId=$_POST['lstscheme'];
print $SchemeId=$Result[$i]['scheme_id'];
print $Schemehours=$Result[$i]['scheme_hours'];
print '<option value="'.$SchemeId.'" >'.$SchemeId.'</option>';
$i++;
}
?>
</select>

_Aerospace_Eng_
06-21-2010, 07:19 AM
<select name="lstscheme">
<?php
print '<option value="">--Select--</option>';
while(count($Result)>$i)
{
$SchemeId=$Result[$i]['scheme_id'];
$Schemehours=$Result[$i]['scheme_hours'];
print '<option value="'.$SchemeId.'" >'.$SchemeId.'</option>';
$i++;
}
?>
</select>
Try that. You tried to print. I suggest you learn the basics of php. It doesn't seem that you have a grasp at it yet. You've been making very simple mistakes.

bamboli
06-22-2010, 08:57 AM
thanks for giving the correct code...



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum