server-php-sqlite-voting-sql.php / php
<?php //header ("Content-type: image/png"); red = imagecolorallocate (black = imagecolorallocate (
mysql_connect("localhost", "root", "hush"); mysql_query("USE local"); optionsquery = mysql_query("SELECT * FROM voteoptions"); optionsquery); numvotes = mysql_num_rows(
xval = 30; numoptions); for (i<=(i++) { optionsquery,votevalue = mysql_result(i,'value'); // echo votevalue.'<br />'; votevalue'"); currentnumquery); currentnum/numvotes)*184); rper = floor((currentnum/numvotes)*100); imagefilledrectangle (xval, (200-xval+red); imagerectangle (xval, (200-xval+black); imagestring (xval+(voteoption, im, 2, (barwidth/2)), ((200-rper%", xval+=(
imagepng(im,'voting-plot.png'); ?> <center> <img src=voting-plot.png width=100% height=100%> </center>
(C) Æliens 20/2/2008
You may not copy or print any of this material without explicit permission of the author or the publisher. In case of other copyright issues, contact the author.