Welcome Guest, Not a member yet? Register   Sign In
how do you do a newsletter (batches)
#2

[eluser]richthegeek[/eluser]
A simple SQL (MySQL 5+, due to subquery) statement splits the list into groups of 5:
Code:
SELECT GROUP_CONCAT(email,',') AS recipients FROM emails GROUP BY MOD(id,(SELECT ROUND(COUNT(*) / 6) FROM emails));

You can add a WHERE statement between the FROM and GROUP, or a HAVING afterwards (remembering to add the appropriate column in the fieldlist) to limit by unsent.

Hope that helps.


Messages In This Thread
how do you do a newsletter (batches) - by El Forum - 07-11-2009, 09:36 PM
how do you do a newsletter (batches) - by El Forum - 07-11-2009, 10:20 PM
how do you do a newsletter (batches) - by El Forum - 07-11-2009, 10:53 PM
how do you do a newsletter (batches) - by El Forum - 10-05-2009, 08:35 AM
how do you do a newsletter (batches) - by El Forum - 10-05-2009, 08:40 AM
how do you do a newsletter (batches) - by El Forum - 10-05-2009, 08:49 AM
how do you do a newsletter (batches) - by El Forum - 10-05-2009, 09:18 AM



Theme © iAndrew 2016 - Forum software by © MyBB