<?php
// Make a MySQL Connection
$objConnect = mysql_connect("localhost","root","1234") or die("Error Connect to Database");
$objDB = mysql_select_db("book1");
$query = "SELECT PCODE2, COUNT(PCODE2) FROM book1 GROUP BY PCODE2";
$result = mysql_query($query) or die(mysql_error());
// Print out result
while($row = mysql_fetch_array($result)){