include "connectionDb.php";
$sql="select orderid,pro_id,item_price,sum(quantity) quantity
from order_item group by pro_id order by quantity desc";
$result=mysql_db_query($dbname,$sql);
$sql2="select pd_name from tbl_product where
pd_id='$pro_id'";
$result2=mysql_db_query($dbname,$sql2);
$rs2=mysql_fetch_array($result2);
$pd_name=$rs2[pd_name];
drawbar($im,45,5,$quantity,$pro_id);
$shadow = ImageColorAllocate($im,170,170,170);
imagestring($im, 5, 61, 86, "My Bar Chart!", $shadow);
imagestring($im, 5, 60, 85, "My Bar Chart!", $blk);
}