<?php


function valueFromTable($valuename,$db)
{

	$data = "SELECT settingInt
	FROM valuesettings
	WHERE settingName = '$valuename';";

	$resultData = mysqli_query($db,$data);

	$countData = mysqli_num_rows($resultData);

	if ($countData != 0) {

		while ($rowData = mysqli_fetch_array($resultData)) { 
			return $rowData['settingInt'];
		}

	} else {

		return 0;
	}

}
?>