I have list box which is displaying data from three columns

Hi

All

I have list box which is displaying data from three columns of a table. when user clicks on the any of the option i want to save only the first column value

The code is given below

echo “<select name=‘package’>”;

while($row = mysql_fetch_assoc($result))
{

$test= $row[‘package_id’].‘-’.$row[‘package_details’].‘-’.$row[‘fair’];

echo “<option value=$test>$test”;

}

echo"</select>";

thanks and regards
MD.Samiuddin

explode

You can use split too…


$package=$_POST['package'];
list($package_id,$package_details,$fair)=split("-",$package);