Hi all
Simple question , i hope!
I have an events database that i am producing tickets from. I want to be able to loop an event record x number of times, showing the count on each instance - i.e. ticket no. 1, 2, 3, etc. I can get the record to output the first time, but for the subsequent "tickets", i get no output but the ticket number.
My loop:
please can anyone point me in the right direction, been trying all sorts of examples from the 'net for a few hours now!
Nicola
Simple question , i hope!
I have an events database that i am producing tickets from. I want to be able to loop an event record x number of times, showing the count on each instance - i.e. ticket no. 1, 2, 3, etc. I can get the record to output the first time, but for the subsequent "tickets", i get no output but the ticket number.
My loop:
Code:
<?php
//set the number of columns
$columns = 2;
//we add this line because we need to know the number of rows
$num_rows = 51;
// changed this to a FOR loop so we can use the number of rows
for($i = 1; $i < $num_rows; $i++)
{
$row = mysql_fetch_array($getEvent_res);
// now, output the ticket information for each ticket in the loop to 50
?>
<div class="ticket_container">
<div id="ticket">
<?php echo "<h3>". $row['EventTitle']. " </h3>
with
<h2>". $row['MediumName']."</h2>";?>
<p><?php echo $row['EventDetails']; ?></p>
<p>On <?php echo $row['fmt_date']; ?></p>
<p> at <?php echo $row['fmt_time']; ?></p>
<p class="ticket_no">ticket no: <?php echo $i; ?></p>
</div>
</div>
<?php
}
// now close connections to the database
mysql_close($mysql);
?>
please can anyone point me in the right direction, been trying all sorts of examples from the 'net for a few hours now!
Nicola