TaylorSandbek Posted April 29, 2008 Share Posted April 29, 2008 Building a site/facebook app that is pretty complex (as they say, my eyes were larger then my stomach, so my imagination is larger then my skills) and well, obviously Ive run into some problems. One of the main features of this is that it notifies you when your friend has requested an event. (wont get into further detail as it is not necessary). But Im lost as to how I would do this. My one solution was store the request for an event in my database, then everytime someone logged on I would check for stored event request. But then How would I determine which requests where replied to/deleted? Would I use some number increment system like when page views != 1 do not show? I think that is the route to take but I am not quite sure how I would write that out. As I said in the beginning, Im a learning coder with very limited knowledge. Im not asking anyone to write this out for me, as that would be counterproductive to actually learning, but rather to explain to me the concept of how I would do this, because I am pretty lost. Thanks in advance for the help - the n00b Quote Link to comment https://forums.phpfreaks.com/topic/103442-need-some-help/ Share on other sites More sharing options...
SharkBait Posted April 29, 2008 Share Posted April 29, 2008 You could have a flag that is like 0 = Not read and 1 = Read So when they log in, you would look for all items that are 0 = Not Read and then when they view them you change it to 1 for being read. Psuedo Example (if you're using a database of sorts like MySQL) Johnny logs in and see 4 new items (SELECT * FROM meh WHERE read = 0) Results = 4 items unread Johnny views each item individually and it is marked as being seen/read (UPDATE meh SET read = 1 WHERE id = 'some_id') some_id = unique identifier of each row item in the table for the events he looks at. Quote Link to comment https://forums.phpfreaks.com/topic/103442-need-some-help/#findComment-529707 Share on other sites More sharing options...
TaylorSandbek Posted April 29, 2008 Author Share Posted April 29, 2008 Thanks for the quick reply sharkbait.. very helpful. Implementing this as we speak Quote Link to comment https://forums.phpfreaks.com/topic/103442-need-some-help/#findComment-529713 Share on other sites More sharing options...
TaylorSandbek Posted April 29, 2008 Author Share Posted April 29, 2008 This is correct? $events = "SELECT events FROM user WHERE username ='$username' WHERE read==0"; Quote Link to comment https://forums.phpfreaks.com/topic/103442-need-some-help/#findComment-529716 Share on other sites More sharing options...
sasa Posted April 29, 2008 Share Posted April 29, 2008 no $events = "SELECT events FROM user WHERE username ='$username' AND read=0"; Quote Link to comment https://forums.phpfreaks.com/topic/103442-need-some-help/#findComment-529720 Share on other sites More sharing options...
TaylorSandbek Posted April 29, 2008 Author Share Posted April 29, 2008 my mistake. Quote Link to comment https://forums.phpfreaks.com/topic/103442-need-some-help/#findComment-529723 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.