php - How do I select emails from list to send -
i have user's role table called lookup_roles , contain user_id, email, , role fields.
i need pull emails of rows have 's' (s stands test in system) in role field , put them $to else statement below emailed.
if ($production == 'y' ) { $subject = "production subject"; $to = 'prodemail@email.com' . ', '; } else { $subject = "[test]"; $to = 'testemai1@email.com' . ', '; $to .= 'testemail2@email.com ' . ', ';
i have feeling it's pretty simple. appreciate help. i'm still noob @ this.
select email lookup_roles role 's'
and walk through results , put them $to variable.
Comments
Post a Comment