<?php
function getIETValue($db,int $noOfDependents) {

$ietcategory = "z";
$ietvalue = 0;

switch ($noOfDependents) {
  case 0:
    $ietcategory = "a";
    break;
  case 1:
    $ietcategory = "b";
    break;
  case 2:
    $ietcategory = "c";
    break;
  case 3:
    $ietcategory = "d";
    break;
  default:
    $ietcategory = "e";
}

$sqlIET = "SELECT * FROM iet_categories
          WHERE category = '" . $ietcategory . "'";

$resultIET = mysqli_query($db,$sqlIET);

$countIET = mysqli_num_rows($resultIET);

if ($countIET !== 0) {

	while ($rowIET = mysqli_fetch_array($resultIET)) {

		$ietvalue = $rowIET['value'];
		return $ietvalue; 

	}

	}

}

?>