Google Answers Logo
View Question
 
Q: PHP: Email notification to members based on search criteria ( No Answer,   0 Comments )
Question  
Subject: PHP: Email notification to members based on search criteria
Category: Computers > Programming
Asked by: komlos-ga
List Price: $15.00
Posted: 19 Feb 2004 04:37 PST
Expires: 19 Feb 2004 05:00 PST
Question ID: 308305
Hi, 

I'd like to create a mail alert, notification script which sends email
to members in the mysql db if there is a new ad posted in the db,
filtered by the criterias each member set. This is in PHP and mySQL.
Similar to what latest php forums use. I have an existing solution but
it doesn't work the way I want.

I have an "ads" table and the an "alert" table. 
In the ads table members post their ads with usual fields like: 
ad_id, member_id, category, subject, description, city, biztype, etc... 

In the alert table they can post their search criterias and their
email address that will be saved.
fields: alert_id, member_id, category, city, biztype, email
(Members can subscribe to multiple categories, thus each member can
have multiple rows in the table. However, only categories will
differ.)

Now when I run the script I want it to "scan through" the two tables
compare them and send email only to those members that have criterias
matching those fields in the "ads" table.

Important thing that I'd like to have it send only one email per
member. In the body of the email there would be the "search result",
the list of matching ads for that member like this:

Subject of ad 1 
Link for ad 1 

Subject of ad 2 
Link for ad 2 

Subject of ad 3 
Link for ad 3 

. 
. 
. 

etc. 

Please give me a suggestion or solution. Maybe I could use nested
while loops, but I'm not sure how.

I want to run the script daily, so it would select the ads that were
posted in the last 24 hours.

Thank you
Answer  
There is no answer at this time.

Comments  
There are no comments at this time.

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  


Google Home - Answers FAQ - Terms of Service - Privacy Policy