<?php include "check_login.php"; ?>
<?php
include 'dbcon.php';

$q = "SELECT COUNT(*) AS total 
      FROM notifications 
      WHERE role='pm' and user_id='$userpmid' AND is_seen=0";

$res = mysqli_query($conn, $q);
$row = mysqli_fetch_assoc($res);

echo $row['total'];
?>