Sorry about that there actaually ten drop down boxes in this code named bap1 to bap10 but here is the code
<select name="bap10">
<option selected="selected">Select One</option>
<option value="Energy Efficient Cooking">Energy Efficient Cooking</option>
<option value="Re-Usable Bags">Re-Usable Bags</option>
<option value="Keep Fridge/Freezer Ice Free">Keep Fridge/Freezer Ice Free</option>
<option value="No Stand By">No Stand By</option>
<option value="Use Energy Meter">Use Energy Meter</option>
<option value="Use Radio Other Than TV">Use Radio Other Than TV</option>
<option value="Recycling">Recycling</option>
<option value="Stop Junk Mail">Stop Junk Mail</option>
</select>
</td>
<td width="19%">
<input name="pledging" type="text" id="pledging" maxlength="5" />
</td>
<td> </td>
<td> </td>
</tr>
<tr>
<td colspan = '3'>Total Savings and Expenditure</td>
<td> </td>
<td> </td>
</tr>
</table>
<input type="Submit" name="select" value="select">
</form>
<?php
// if something has been chosen
if (!empty($select)) {
// select the type from the database
// database connection details (change to whatever you need)
$HOST = 'localhost';
$DATABASE = '';
$USER = ';
$PASSWORD = '';
}
// connect to database
if(!$conn=mysql_connect('localhost','','')) {
echo("<li>Can't connect to $HOST as $USER");
echo("<li>mysql Error: ".mysql_error());
die;
}
// select database
if (!mysql_select_db($DATABASE,$conn)) {
echo("<li>We were unable to select database $DATABASE");
die;
}
// if everything successful create query
// this selects all rows where the type is the one you chose in the dropdown
// * means that it will select all columns, ie name and type as i said above
$_POST['bap1'] = "SELECT * FROM Behaviour WHERE Product LIKE '$bap1'";
$_POST['bap2'] = "SELECT * FROM Behaviour WHERE Product LIKE '$bap2'";
$_POST['bap3'] = "SELECT * FROM Behaviour WHERE Product LIKE '$bap3'";
$_POST['bap4'] = "SELECT * FROM Behaviour WHERE Product LIKE '$bap4'";
$_POST['bap5'] = "SELECT * FROM Behaviour WHERE Product LIKE '$bap5'";
$_POST['bap6'] = "SELECT * FROM Behaviour WHERE Product LIKE '$bap6'";
$_POST['bap7'] = "SELECT * FROM Behaviour WHERE Product LIKE '$bap7'";
$_POST['bap8'] = "SELECT * FROM Behaviour WHERE Product LIKE '$bap8'";
$_POST['bap9'] = "SELECT * FROM Behaviour WHERE Product LIKE '$bap9'";
$_POST['bap10']= "SELECT * FROM Behaviour WHERE Product LIKE '$bap10'";
//product 1 sum
$result = mysql_query($_POST['bap1'],$conn) or die('Invalid query: ' . mysql_error());
$details = mysql_fetch_array($result);
$bap1units = $bappledging1 = $_POST['pledging1'];
$bap1mes = $details['mesurements'];
$bapanswer1 = $bap1mes*$bap1units;
?>
Hope this helps a little more