Here is a sample code snipit of joining the Registration, User and Payments tables to view information all in one list with one query:
// Create the Registration class
$myRegistration = new Registration;
$display[] = array('registration_id','user_id','date_registered','guests');
// Create the User Class
$tmpUser = new Users;
$myRegistration->Join($tmpUser, 'user_id', 'INNER');
$display[] = array('first_name','last_name');
// Create the Payments Class
$tmpPayment = new Payment;
$myRegistration->Join($tmpPayment, 'conference_id', 'INNER');
$display[] = array('conference_id', 'amount', 'status', 'method');
// Get a list of all the Registrations
$myRegistration->GetList($display,'date_registered','DESC');
Questions or Concerns? Head over to our Simpl Group.
No comments:
Post a Comment