<?php

$SQL = "create view view_usersubscriptions as

          select usersubscriptions.*,
                 date_format(usersubscription_created, '%c/%e/%Y %l:%i %p') as usersubscription_created_verbose,
                 date_format(usersubscription_changed, '%c/%e/%Y %l:%i %p') as usersubscription_changed_verbose,
                 date_format(usersubscription_start_date, '%c/%e/%Y')       as usersubscription_start_date_verbose,
                 date_format(usersubscription_end_date, '%c/%e/%Y')         as usersubscription_end_date_verbose,
                 
                 subscriptions.subscription_title                           as usersubscription_title_verbose,
                 CONCAT_WS(' ', subscriptions.subscription_title, service_levels.dropdown_value, markets.dropdown_value) AS subscription_full_title
                 
            from usersubscriptions
            
       left join subscriptions
              on subscriptions.subscription_serial = usersubscriptions.usersubscription_subscription
              
       left join dropdowns as service_levels
                    ON service_levels.dropdown_serial = subscriptions.subscription_service_level
                    
       left join dropdowns markets
                    ON markets.dropdown_serial = subscriptions.subscription_market";

//order by subscription_title or the order of old system
?>