This show only records between a certain range for a certain group or client
mysql_select_db($database_reuniomysql, $reuniomysql);
$query_rsphotobuclass = sprintf("SELECT DISTINCT class_ticket_purchases.purchase_ticket_id, class_ticket_purchases.purchase_ticket_title, class_ticket_purchases.purchase_ticket_class_id, class_ticket_purchases.purchase_reunion_year, class_ticket_purchases.purchase_ticket_price FROM class_ticket_purchases WHERE class_ticket_purchases.purchase_ticket_id between '2' and '4' AND class_ticket_purchases.purchase_ticket_class_id=%s GROUP BY purchase_ticket_id", GetSQLValueString($KTColParam1_rsphotobuclass, "int"));
The bold show only records between a range of 2-4 (2,3,4) for only 1 class (class_id) - must be grouped (ticket_id) to work. range is distinct meaning it will only show items that are unique not the same items over and over again.