Hi nerd,
Thank you for your concern on my errors. I am sending you the code for test.php as follows:
Test.php
<?php
header ("Content-type: image/png");
$im = imagecreatefrompng ("graphtemp.png");
$red = imagecolorallocate ($im, 255, 0, 0);
$black = imagecolorallocate ($im, 0, 0, 0);
mysql_connect("localhost", "dmis", "dmis");
mysql_query("USE dmis");
$optionsquery = mysql_query("SELECT FROM individuals");
$numoptions = mysql_num_rows($optionsquery);
$pollquery = mysql_query("SELECT FROM casualty");
$numvotes = mysql_num_rows($pollquery);
$xval = 30;
$barwidth = floor(300/$numoptions);
for ($i=0;$i<=($numoptions-1);$i++)
{
$voteoption = mysql_result($optionsquery,$i,'name');
$votevalue = mysql_result($optionsquery,$i,'value');
$currentnumquery = mysql_query("SELECT count() FROM casualty WHERE pid='$votevalue'");
$currentnum = mysql_num_rows($currentnumquery);
$per = floor(($currentnum/$numvotes)184);
$rper = floor(($currentnum/$numvotes)*100);
imagefilledrectangle ($im, $xval, (200-$per), ($xval+$barwidth), 200, $red);
imagerectangle ($im, $xval, (200-$per), ($xval+$barwidth), 200, $black);
imagestring ($im, 1, ($xval+($barwidth/2)), 205, $voteoption, $black);
imagestring ($im, 2, ($xval+($barwidth/2)), ((200-$per)-15), "$rper%", $bla);
$xval+=($barwidth+10);
}
imagepng($im);
?>
And the bargraph generator was downloaded from your website www.phpbuilder.com and the name of the generator is PHP BARGRAPH GENERATOR.
So please look into my code and let me know soon.
Thank You