dthomas31uk Posted October 20, 2008 Share Posted October 20, 2008 Hi guys. have amended my option boxes had the following and it worked a treat echo 'Full Load'."<label><input type='radio' name='load' value='full_load'</label>"; echo 'Half Load' . "<label><input type='radio' name='load' value='half_load'</label>"."<BR>"; which calculated the result as follows if ($load == 'full_load') { $total = $row['full_price']; } else { $total = $row['half_price']; } However, I have now added another option box like so echo 'Load from 14m3 - 20m3' . "<label><input type='radio' name='load' value='luton'</label>"."<BR>"; echo 'Load from 7m3 - 14m3'."<label><input type='radio' name='load' value='full_load'</label>"."<BR>"; echo 'Load from 1m3 - 7m3' . "<label><input type='radio' name='load' value='half_load'</label>"."<BR>"; but I am having trouble getting the results calculated with the 3 options have tried the following switch($load) { case "full_load": $total = $row['full_price']; break; case "half_price": $total = $row['half_price']; break; case "luton": $total = $row['luton']; break; } Any help or advice would be most appreciated Link to comment https://forums.phpfreaks.com/topic/129213-help-with-option-boxes-getting-results-from-my-database/ Share on other sites More sharing options...
Andy-H Posted October 20, 2008 Share Posted October 20, 2008 switch($load) { case "full_load": $total = $row['full_price']; break; case "half_load": $total = $row['half_price']; break; case "luton": $total = $row['luton']; break; } Link to comment https://forums.phpfreaks.com/topic/129213-help-with-option-boxes-getting-results-from-my-database/#findComment-669905 Share on other sites More sharing options...
dthomas31uk Posted October 20, 2008 Author Share Posted October 20, 2008 Thats the same as I have already Andy Link to comment https://forums.phpfreaks.com/topic/129213-help-with-option-boxes-getting-results-from-my-database/#findComment-669908 Share on other sites More sharing options...
Andy-H Posted October 20, 2008 Share Posted October 20, 2008 switch($load) { case "full_load": $total = $row['full_price']; break; case "half_load": //<-- EDITED HERE $total = $row['half_price']; break; case "luton": $total = $row['luton']; break; } Link to comment https://forums.phpfreaks.com/topic/129213-help-with-option-boxes-getting-results-from-my-database/#findComment-669965 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.