Sorry. It doesn't do anything.
Oh and btw, I made it so it DOES call on the function.
It would help if we knew what the error or problem was?
----- Original Message -----
From: "Vladimir Kravtsov" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, June 15, 2001 13:13
Subject: What's wrong here?
<?php
require('common.php');
function DisplayPoll() {
connectdb();
mysql_select_db(pollbooth);
$sql = "select choice from choices";
$query = mysql_query($sql);
$num_of_voting_choices = mysql_num_rows($query);
$sql = "select choice from votes";
$query = mysql_query($sql);
$number_of_votes = mysql_fetch_array($query);
for ($i = 0; $i < $num_of_choices; ++$i) {
$sql = "select id from votes where choice='$i'";
$query = mysql_query($sql);
$num_of_rows_for_choice = mysql_num_rows($query);
$choice_percentage = "$number_of_rows_for_choice / $number_of_votes";
$number_of_pixels_to_print = "$choice percentage / 5";
for ($x = 0; $x < $number_of_pixels_to_print; ++$x) {
echo("<img src="."$color_choice".">");
echo(" "."$choice_percentage"."\%");
}
}
}
?>
Please help :)
---------------------------------------------------------------------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)
To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php