//Count Number Of Rows
function countRows($sql_get_results, $column = '')
{
if ($sql_get_results and $column) {
$count = 0;
foreach ($sql_get_results as $row) {
$count += $row->$column;
}
} else {
$count = count($sql_get_results);
}
if ($count) {
return $count;
} else {
return "0";
}
}