Welcome visitor
* Login
* Register
It is currently July 20th, 2019, 5:07 am
All times are UTC [ DST ]
* Search
View unanswered posts - View active topics

FORUMS » Server Side » PHP



Post new topic Reply to topic  [ 4 posts ] 
Author Message
  calculate referrals progress
PostPosted: February 26th, 2009, 8:02 pm 
User avatar

Posts: 137
hey there, im desinging a community where users are prompted to refer us to their friends via e-mail and if x number of their friends join the community then the member get a prize. i already know how to store the referred e-mail addresses and, of curse, the joined e-mails too. now, i hope im not confusing you, what would be the best way to compare wich memeber refered whom? cos i think that a while loop would take very long, so any suggestions are welcomed. and if you need more information pleas ask me.


Top
 Profile  
 
  Re: calculate referrals progress
PostPosted: February 26th, 2009, 8:15 pm 

Posts: 55
I dont know how you have all your information organized, but if you can create an array with all the e-mails a particular user provided and another with all the e-mails joined, then you can use
$joined = array_diff($arrayJoined, $arrayReferrals);

and use
$number= count($anyArray);

to calculate the difference.


Top
 Profile  
 
  Re: calculate referrals progress
PostPosted: February 26th, 2009, 8:18 pm 
User avatar

Posts: 137
great, thanks for the idea. still, doesnt it gonna be a littl slow after 1500 users or something? :roll:


Top
 Profile  
 
  Re: calculate referrals progress
PostPosted: February 26th, 2009, 8:23 pm 

Posts: 55
Yes I think so, and hope you can figure out a better way by then :D
Maybe you can add to the register form a question like, How did you hear about us? and filter thus the e-mail referrals.Or send a link on the invitation that would allow you keep track on whose invitation was accepted. I dont know, see what fits best for you!


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

FORUMS » Server Side » PHP


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron