I want to count the value of column in MySQL and show the result in my page using PHP.
I tried this to get the column value
$smt=$conn->prepare("SELECT SUM(Admin_Status) FROM aplic");
$smt->execute();
$result=$smt->fetch(PDO::FETCH_OBJ);
$res=$result->SUM(Admin_Status);
echo $res;
To be more specific, I'm making a PM (personal messaging system) and for that I created the read and unread column in the table, now I want that user see how many new messages (s)he has.
"SELECT SUM(Admin_Status) as AdminStatusSum FROM aplic"which you can then access ->$result->AdminStatusSum;