Need compare code and send email code
Posted: Wed Feb 11, 2009 8:48 pm
This should be simple enough but I'm a real newbie and could use some help.
table_a contains a list of unique_ids
table_b contains a list of unique_ids and email_address, name, message fields.
The unique_ids in table_a may or may not be the same as the unique_ids in table b.
I need a php script that I can run from a cron job that will:
enumerate through the unique_ids in table_a that have the field sent=0 and find their equal match in table_b.
If found:
mark the record in table_a as sent=1, pull the corresponding unique_id, email_address, name and message field from table_b that matched against unique_id from table_a and construct an email message from those fields and send it out the door.
If someone is quick at hand and sharp of mind perhaps they can shoot me the code I need to do this or point me in the right direction.
Thank you!
table_a contains a list of unique_ids
table_b contains a list of unique_ids and email_address, name, message fields.
The unique_ids in table_a may or may not be the same as the unique_ids in table b.
I need a php script that I can run from a cron job that will:
enumerate through the unique_ids in table_a that have the field sent=0 and find their equal match in table_b.
If found:
mark the record in table_a as sent=1, pull the corresponding unique_id, email_address, name and message field from table_b that matched against unique_id from table_a and construct an email message from those fields and send it out the door.
If someone is quick at hand and sharp of mind perhaps they can shoot me the code I need to do this or point me in the right direction.
Thank you!