Jump to content

Email users with specific mySQL values?


Call-911

Recommended Posts

Hello all,

 

Sorry if this has been asked before, but I have tried searching here and Google and just can not find what I need.

 

Basically, I have a database that includes names, emails, and the amount they owe.

 

I would like to be able to send out a mass email to everyone in that database, and have it basically say:

 

"Hello <name>, you currently owe <amountdue>."

 

I can't figure out how to do this...

 

Any help would be great!!  or just a shove in the right direction to the proper tutorial! THanks!

Link to comment
https://forums.phpfreaks.com/topic/203906-email-users-with-specific-mysql-values/
Share on other sites

First you need to query the database, then check if a result was returned, then turn the result into an array so that you can use it. Loop through that array to go row by row through the result that was returned from your query. You would fill in the blanks of your email, and send it, then move on to the next iteration of the looping. Sending the email is very basic, and you will find almost unlimited tutorials on the internet about sending email in php.

 

If you don't understand this, you should read a beginner PHP/MySQL book, because this is the basics. It would be a good thing to learn as a simple first project because it involves a simple MySQL query, and using the result of the query in an emaiil.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.