Jump to content

Problem with displaying query


joecooper

Recommended Posts

Hi,

 

my site is displaying something weird, http://86.21.243.231/

 

on the table at the bottom, it should list the amount of tickets sold. if the user deposits 0.3, then it should display 3 seperate rows for 0.1 with their payout address.

 

but for 0.3, it displays 2 rows of 0.15 instead.

 

the code for the table is:

 

 

$sql="SELECT * FROM tickets WHERE `round` = '$round' AND `confirmed` = 'yes' ORDER BY timestamp ASC";
$result=mysql_query($sql);
$row=mysql_fetch_array($result);

$result=mysql_query($sql);

while($row = mysql_fetch_array( $result )) {
$ticketamount = $row['amount'];
$ticketspurchased = (int)($ticketamount / $ticketprice);

$ticketamount = $ticketamount / $ticketspurchased;
for ( $counter = 1; $counter <= $ticketspurchased; $counter += 1) {
  $i++;
  echo "<tr><td>"; 
  echo $i;
  echo "</td><td>"; 
  echo $row['address'];
  echo "</td><td>";
  echo $ticketamount;
  echo "</td><td>";
  echo $row['confirmed'];
  echo "</td><td>";
  echo $row['timestamp'];
  echo "</td></tr>";
}
}

 

0.5 shows correctly

 

Any ideas?

Link to comment
https://forums.phpfreaks.com/topic/245801-problem-with-displaying-query/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.