I am writing a script which will run automatically once a month. The script will query a database, selecting records with a specific value in one of the fields. The results will be thrown into an email sent by php mail.
I would like 1 email to be sent (vs. a separate email for each record) with all of the records neatly displayed in the email.
Thus far, I have been able to send either a completely blank email or a bunch of emails, one for each entry in this table of the database (right now only 5).
Using php mail, how can I 'loop' the query results within the $message variable, so that when the email is sent, it is sent showing all of the results in a table format?
Name ------ Student ID --- Dorm --- Room --- Setup Fee --- Other Fee
Jones, Bill A D11122334 J 6 $20 $10
Bates, Jon C D11122354 B 12 $0 $50
etc...
Thanks!