Currently I have two tables A and B. The DID is input by the user into into a input, and that is the first prompt in my program, to enter the DID.
A contains PID, DID, and MaxOccupancy. PID is professional id, DID is department id. B contains CID, DID, and PID. CID is client ID, and DID and PID is same.
I'm outputting data from the first table into an html table which shows all that data.
However, I'm having trouble running a count on number of PID from table two. I have $countB= mysql_query ("select count (PID) from B where DID=('$_POST[DID])");
I am then writing
while($row = mysql_fetch_array($countB))
{
echo "Current occupancy:".$row['count(PID)'].;
}
Can someone help me? How do i do a where in my query for the count to get what the user put in for DID in the input box? Am i doing it wrong completely?
THANkS!