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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.