For mange decimaler
Hey eksperter...Kan ikke rigtig finde ud af hvordan jeg begrænser antallet at decimaler.
Her er koden:
$ans4="SELECT * from P_choices";
$ans5=mysql_query($ans4);
while($ans6=mysql_fetch_array($ans5))
{
if($total>0)
{
$imagewidth=(100*$ans6[votes])/$total;
print "<table width='100%' border='0' cellspacing='0' cellpadding='0'><tr><td width='125'><b>$ans6[answer]</b></td><td><img src='images/poll_pic.jpg' height='10' width='$imagewidth' border='0'></td></tr><tr><td colspan='2'>($imagewidth %)</td></tr></table><br>";
}
else
{
print "No votes have been cast yet";
}
}
$ID=$_POST['answer'];
$ipinsert="Insert into P_ip(IP) VALUES('$s')";
mysql_query($ipinsert);
$vote = "UPDATE P_choices SET votes=votes+1
WHERE ID = '$ID'";
mysql_query($vote);
På forhånd tak! :)
