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

Popular posts from this blog

java - Plugin org.apache.maven.plugins:maven-install-plugin:2.4 or one of its dependencies could not be resolved -

Round ImageView Android -

How can I utilize Yahoo Weather API in android -