Is it possible to adapt this mysql statement:
$sql = "SELECT u.user_registered, 
               u.first,
               u.last,
               c.class_grade 
        FROM users u 
        JOIN classes c on 
           c.class_id  = u.class_id and
        WHERE user_registered >=  '".  $from  . "' 
          and user_registered <  '".  $to  . "' 
        ORDER by u.last " ;
I want to group grades into an age category: 'young' and 'old'
if c.class_grade = 1,2, or 3, then age = 'young' if c.class_grade = 4,5, or 6, then age = 'old'
Finally add this new "age" category to the ORDER BY