List:General Discussion« Previous MessageNext Message »
From:Rolf Hopkins Date:June 15 2001 3:37am
Subject:Re: What's wrong here?
View as plain text  
Well, that isn't much to go on.  I suggest you put a few print statements to
find out what's happening and also try the sql statement in the mysql prompt
to see if the sql statement does what it is suppose to.  Remember, if you're
printing this in a table, error messages and results may not always be
displayed on the web page.  You may have to "view source".


----- Original Message -----
From: "Vladimir Kravtsov" <vkravtsov@stripped>
To: <mysql@stripped>
Sent: Friday, June 15, 2001 14:08
Subject: RE: What's wrong here?




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" <vkravtsov@stripped>
To: <mysql@stripped>
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 <mysql-thread76649@stripped>
To unsubscribe, e-mail
<mysql-unsubscribe-vkravtsov=home.com@stripped>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php





Thread
What's wrong here?Vladimir Kravtsov15 Jun
  • Re: What's wrong here?Rolf Hopkins15 Jun
RE: What's wrong here?Vladimir Kravtsov15 Jun
  • Re: What's wrong here?Rolf Hopkins15 Jun