A community in which webmasters can ask for help with topics such as PHP coding , MySQL , IT jobs, web design, IT security.
Current location:homephp forumphp talk in 2009 yearphp & mysql subscribe to search/matching queries - page 1
User InfoPosts
php & mysql subscribe to search/matching queries#1
I have a real estate website that has several categories.
And i want the users to be able to subscribe via email to a certain list of offers, they can either be offers from a category ... or offers from a search list.

How can i store they(re subscription the best way in mysql ... and also how do i go about and do the notification.

The best i came up with is to have a mysql sting stored in mysql table with the user ID and run a cron that takes all of that and iterates through it ... runs the cron and if there are new ads it sends an email.

But i don(t think that this is the best idea, since it also means that if there is a change in database design ( ex, field names ) then all those queries would go bad.

thanks a lot

posted date: 2009-04-09 00:59:00


Re: php & mysql subscribe to search/matching queries#2
I had made out the solution of this problem. click to view my topic...

hope that hepls.

posted date: 2009-04-09 00:59:01


Re: php & mysql subscribe to search/matching queries#3
If you change database design, you(ll certainly have to fix something, that(s how this world works.If for some reason it(s hard for you to change the cron task, you can create a stored procedure that always returns a resultset suitable for the task, and change the stored procedure instead.

posted date: 2009-04-09 01:07:00


Re: php & mysql subscribe to search/matching queries#4
In general you want to design your tables to be as flexible as possible to account for unexpected change. If those fields change your queries would need to change anyway.Without having the specifics, these would be my guidelines:Have a Users Table with the index and emailHave a subscription types tableHave a User ID + Subscription lookup tableHave a pending messages tableWhen a new update is present, collect all the emails and create a message log entry into a pending messages table.Build your Cron to grab 20 unsent messages every few minutes and delete the message once it(s sent.The reason I say to iteratively send them via the CRON is because as your subscribers grow you don(t want to have hundreds of emails have to go out at once and tie up your server(s resources for the mail queue. You can just keep adding messages as need be and your queue will consistently send them out.We have been using this method pretty effectively for all our mass-emailing applications, error logging and reminder notification systems. It may not be the best solution but it(s shown to be very manageable and flexible.

posted date: 2009-04-09 01:08:00


Re: php & mysql subscribe to search/matching queries#5
but is it ok if i store the query in the subscription table ? or is it recomended to store it in a different way ?

posted date: 2009-04-09 01:11:00


Re: php & mysql subscribe to search/matching queries#6
Which query? You have several throughout this process.

posted date: 2009-04-09 01:12:00


Re: php & mysql subscribe to search/matching queries#7
the one that grabs the ads the user wants to subscribe

posted date: 2009-04-12 12:23:00


select page: « 1 »
Copyright ©2008-2017 www.momige.com, all rights reserved.