I'm working on an OSC mod, but right now there seems to be no one that can offer assistance.
I wrote the following query using a HTTP_GET_VARS. The prior page is working correctly and delivering the variable, my query runs raw against the db, but I'm not doing something correct within PHP as I get no output from the query. There is test data in the db, so I'm really confused. I'm not very experienced and basically what I've learned is reading all I can and working with exisiting queries. I've been pretty sucessuful thus far, but this one has me hitting a wall. Any help or suggestions would really be appreciated. By the way, this is an event system but no changes to the db so for my logic product_id = event_id and attendees_id = customers_id. I'm sure you get the idea. The output is to be a simple list of all who registered (purchased) the event_id (product_id) in the URL. Not rocket science, but I feel really brain dead at this point. 😕
Ruth in AZ
URL VAR = attendee_listing.php?page=1&products_id=43
<!-- Begin Attendee_listing //-->
<?php
if ($HTTP_GET_VARS['page'] > 1){
$rows = $HTTP_GET_VARS['page'];
$pID = 0;
}
if (isset($HTTP_GET_VARS['pID']))
{
$pID = $HTTP_GET_VARS['pID'];
}
$attendee_query_raw = "select c.customers_firstname, c.customers_id, c.customers_gender, op.products_id from " . TABLE_CUSTOMERS . " c, " . TABLE_ORDERS_PRODUCTS . " op, " . TABLE_ORDERS . " o WHERE c.customers_id = 'o.customers_id' AND o.orders_id = 'op.orders_id' and op.products_id = '" . $pID . "' group by c.customers_firstname order by c.customers_gender";
$attendee_split = new splitPageResults($HTTP_GET_VARS['pID'], MAX_DISPLAY_ATTENDEE_LISTING, $attendee_query_raw, $attendee_query_numrows);
$attendee_query_numrows = tep_db_query("select customers_id from " . TABLE_ORDERS . " group by customers_id");
$attendee_query_numrows = tep_db_num_rows($attendee_query_numrows);
$attendee_query = tep_db_query($attendee_query_raw);
while ($attendee = tep_db_fetch_array($attendee_query)) {
$rows++;
}
if (strlen($rows) < 2) {
$rows = '0' . $rows;
}
?>
<td class="dataTableContent"><?php echo $rows; ?>.</td>
<td class="dataTableContent"><?php echo $attendee['customers_firstname'] . ' ' . $attendee['customer_id'] . '</a>'; ?></td>
</tr>
<?php
?>