<?php 
include('r_dbc.php');

$sql = "SELECT count(*) as cnt_ccgrp from centers_groups where pid = '".$pid."'";

$result = mysqli_query($conn, $sql);
if (mysqli_num_rows($result) > 0) {
      while($row = mysqli_fetch_assoc($result)) {
		$cnt_ccgrp 	= $row["cnt_ccgrp"];
		}
} 
mysqli_close($conn);

?>

<?php 
include('r_dbc.php');

$sql = "SELECT count(*) as cnt_cc from centers where pid = '".$pid."'";

$result = mysqli_query($conn, $sql);
if (mysqli_num_rows($result) > 0) {
      while($row = mysqli_fetch_assoc($result)) {
		$cnt_cc 	= $row["cnt_cc"];
		}
} 
mysqli_close($conn);

?>

<?php 
include('r_dbc.php');

$sql = "SELECT count(*) as cnt_catgrp from categs_groups where pid = '".$pid."'";

$result = mysqli_query($conn, $sql);
if (mysqli_num_rows($result) > 0) {
      while($row = mysqli_fetch_assoc($result)) {
		$cnt_catgrp 	= $row["cnt_catgrp"];
		}
} 
mysqli_close($conn);

?>

<?php 
include('r_dbc.php');

$sql = "SELECT count(*) as cnt_cat from categs where pid = '".$pid."'";

$result = mysqli_query($conn, $sql);
if (mysqli_num_rows($result) > 0) {
      while($row = mysqli_fetch_assoc($result)) {
		$cnt_cat 	= $row["cnt_cat"];
		}
} 
mysqli_close($conn);

?>