mirror of
				https://github.com/fspc/Yellow-Bike-Database.git
				synced 2025-10-31 00:45:35 -04:00 
			
		
		
		
	Changed to show only the most recent membership.
This commit is contained in:
		
							parent
							
								
									afb64b7420
								
							
						
					
					
						commit
						8089b40f19
					
				| @ -58,11 +58,11 @@ $purchase_query = "SELECT contacts.contact_id, | |||||||
| CONCAT(last_name, ', ', first_name, ' ',middle_initial) AS full_name,  | CONCAT(last_name, ', ', first_name, ' ',middle_initial) AS full_name,  | ||||||
| CONCAT(first_name, ' ', last_name) AS normal_full_name, | CONCAT(first_name, ' ', last_name) AS normal_full_name, | ||||||
| contacts.email AS email, contacts.phone AS phone,  | contacts.email AS email, contacts.phone AS phone,  | ||||||
| transaction_log.date AS sort_hours, SUBSTRING_INDEX(DATE_ADD(date, INTERVAL 365 DAY), ' ', 1) AS expiration_date | MAX(transaction_log.date) AS sort_hours, SUBSTRING_INDEX(DATE_ADD(date, INTERVAL 365 DAY), ' ', 1) AS expiration_date | ||||||
| FROM transaction_log  | FROM transaction_log  | ||||||
| LEFT JOIN contacts ON transaction_log.sold_to = contacts.contact_id  | LEFT JOIN contacts ON transaction_log.sold_to = contacts.contact_id  | ||||||
| WHERE SUBSTRING_INDEX(date, ' ', 1) <= DATE_ADD(date, INTERVAL 365 DAY)  | WHERE SUBSTRING_INDEX(date, ' ', 1) <= DATE_ADD(date, INTERVAL 365 DAY)  | ||||||
| AND (transaction_type='Memberships' AND paid=1);";
 | AND (transaction_type='Memberships' AND paid=1) GROUP BY full_name;";
 | ||||||
| $purchased_membership = mysql_query($purchase_query, $YBDB) or die(mysql_error()); | $purchased_membership = mysql_query($purchase_query, $YBDB) or die(mysql_error()); | ||||||
| $num_member_rows = mysql_num_rows($purchased_membership); | $num_member_rows = mysql_num_rows($purchased_membership); | ||||||
| 
 | 
 | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user