//*************1
$sql="SELECT COUNT(Study_dormitory) AS Study_dormitory01 FROM Orders
WHERE Study_dormitory='01'";
$query=mysql_query($sql);
$result=mysql_fetch_assoc($query);
echo $result['Study_dormitory01'];
//*************2
$sql="SELECT Study_dormitory FROM Orders WHERE Study_dormitory='01'";
$query=mysql_query($sql);
$nums=mysql_num_rows($query);
echo $nums;