as an example, the resulting page I want looks like this:
PROGRAM
Event A / Venue / Date Ticket price A1 Ticket price A2
Event B / Venue / Date Ticket Price B1 Ticket Price B2 Ticket Price B3
Event C Ticket Price C1 Ticket Price C2 Ticket Price C3
But the resulting page that I'm seeing looks like this:
PROGRAM
Event A / Venue / Date Ticket price A1 Ticket price A1 Ticket price A1 Ticket price A2 Ticket price A2 Ticket price A2
Event B / Venue / Date Ticket Price B1 Ticket Price B1 Ticket Price B1 Ticket Price B2 Ticket Price B2 Ticket Price B2 Ticket Price B3 Ticket Price B3 Ticket Price B3
Event C Ticket Price C1 Ticket Price C1 Ticket Price C1 Ticket Price C2 Ticket Price C2 Ticket Price C2
// Get a connection to the database
$cxn = @ConnectToDb($dbServer, $dbUser, $dbPass, $dbName);
// select the events in this program (events have subevents)
// in most cases there are two types of events - encounters and concerts
// encounters and concerts are sub events
$resultListA = mysql_query("select * from events
inner join subEvents on events.groupName = subEvents.seGroup
where events.groupName='$groupBlock'
");
$rowA = mysql_fetch_array($resultListA);
?>
<h1><?php echo $rowA["groupDesc"]; ?></h1>
<table>
<?php
// we loop through the sub events and make a row with the subevent information
mysql_data_seek($resultListA,0); while ($rowA = mysql_fetch_array($resultListA)) { $Event = $rowA["seSKU"];
?>
<tr><td>
<?php echo $rowA["seDesc"]; ?><br />
<?php echo $rowA["seVenue"]; ?><br />
<?php echo date ("l, F j, Y", mktime ( 0, 0, 0, substr($rowA["seDate"], 5,2), substr($rowA["seDate"], 8,2), substr($rowA["seDate"], 0,4))); ?><br />
</td></tr>
<?php
// we loop through the tickets availale for each subevent
// and make a row for each ticket price under the appropriate sub event
$resultList = mysql_query("select * from subEvents inner join tickets
on subEvents.seGroup = '$groupBlock'
where tickets.itemSubGroup = '$Event'
");
$row = mysql_fetch_array($resultList);
mysql_data_seek($resultList,0);
while ($row = mysql_fetch_array($resultList))
{
?>
<tr><td>
<?php echo $row["itemName"]; ?>
<?php echo $row["itemSubGroup"]; ?>
<a href="orderCart.php?action=add_item&id=<?php echo $row["itemId"]; ?>&qty=1"><?php echo $row["itemName"]; ?> | $<?php echo $row["itemPrice"]; ?></a>
</td></tr>
<?php } } ?> </table>
the queries are extracting the right data from the tables. -- mark hurty | mark@hurty.com | 309.764.0911
-- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php