| | |
Match making scripts
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
•
•
Originally Posted by anthmaina
how do you implement match making using php/mysql?
•
•
Join Date: Sep 2004
Posts: 33
Reputation:
Solved Threads: 0
•
•
•
•
Originally Posted by Troy
I suggest you ask a more specific question. For example, you could ask "I have 2 mysql database tables. One contains basic contact data for the people. The other table has the properties for the people such as 'smoker','loves dogs','college degree', etc. I want to build an alogirthm for matching people by the compatibility of their properties. I want to write the code using PHP, and I have basic PHP skills. I need help building the matching logic."
-basic info table(name,age.....etc)
-appearance info table(height,hair color,...etc)
-interests info table(hiking,music,....etc)
i need help building the matching logic..
Matching people for compatibility is a very complex process. I imagine the algorithms that companies like eHarmony have developed took years of psychology and study as well as programming to develop.
I would imagine that you will have to develop a unique algorithm--a set of logic--for each factor. For example, let's look at "Age". Let's say you've determined that for men:
most compatible woman's age = man's age - (man's age / 10)
most compatible woman's age = 40 - (40/10) = 40 - 4 = 36
And let's say you determine to exclude women:
if woman's age < Round(man's age/1.5)
or if woman's age > Round(man's age * 1.2)
So, for a 40 year old man, you would exclude women if the age is less than 27 or greater than 48.
Then assume you assign a ranking of 5 points per year of age in the compatible range.....or whatever you decide.
Let's say you have 7 women candidates
Woman A: age 23
Woman B: age 27
Woman C: age 30
Woman D: age 36
Woman E: age 38
Woman F: age 48
Woman G: age 51
Women A & B would be excluded because they fall outside the range of 27 to 48.
Woman D would have an age compatibility ranking of 100 (most compatible).
Woman B would have a ranking of 100 - (5 * (36-27)) = 55
Woman C would have a ranking of 100 - (5 * (36-30)) = 70
Woman E would have a ranking of 100 - (5 * (38 - 36) = 80
Woman F would have a ranking of 100 - (5 * (48 - 36) = 40
Armed with this algorithm, you can loop through all the women and determine each one's age compatibility ranking.
Do this for every factor then add up all the factors for each woman to give you an "Overall Compatibility Ranking".
I'd imagine the process of tweaking and refining each factor's algorithm would be a never-ending process.
I would imagine that you will have to develop a unique algorithm--a set of logic--for each factor. For example, let's look at "Age". Let's say you've determined that for men:
most compatible woman's age = man's age - (man's age / 10)
most compatible woman's age = 40 - (40/10) = 40 - 4 = 36
And let's say you determine to exclude women:
if woman's age < Round(man's age/1.5)
or if woman's age > Round(man's age * 1.2)
So, for a 40 year old man, you would exclude women if the age is less than 27 or greater than 48.
Then assume you assign a ranking of 5 points per year of age in the compatible range.....or whatever you decide.
Let's say you have 7 women candidates
Woman A: age 23
Woman B: age 27
Woman C: age 30
Woman D: age 36
Woman E: age 38
Woman F: age 48
Woman G: age 51
Women A & B would be excluded because they fall outside the range of 27 to 48.
Woman D would have an age compatibility ranking of 100 (most compatible).
Woman B would have a ranking of 100 - (5 * (36-27)) = 55
Woman C would have a ranking of 100 - (5 * (36-30)) = 70
Woman E would have a ranking of 100 - (5 * (38 - 36) = 80
Woman F would have a ranking of 100 - (5 * (48 - 36) = 40
Armed with this algorithm, you can loop through all the women and determine each one's age compatibility ranking.
Do this for every factor then add up all the factors for each woman to give you an "Overall Compatibility Ranking".
I'd imagine the process of tweaking and refining each factor's algorithm would be a never-ending process.
•
•
Join Date: May 2006
Posts: 1
Reputation:
Solved Threads: 0
•
•
•
•
Originally Posted by Troy
I suggest you ask a more specific question. For example, you could ask "I have 2 mysql database tables. One contains basic contact data for the people. The other table has the properties for the people such as 'smoker','loves dogs','college degree', etc. I want to build an alogirthm for matching people by the compatibility of their properties. I want to write the code using PHP, and I have basic PHP skills. I need help building the matching logic."
- It is necessary to execute search of conformity in the second table,
Including favourite properties, excepting unloved properties
![]() |
Similar Threads
- Recommendation for Network Inventory tool (Networking Hardware Configuration)
- Hello - Referred by Happy Geek - very grateful (in advance) newbie (Community Introductions)
- [Revised] vBulletin Mod_rewrite Tutorial (PHP)
Other Threads in the PHP Forum
- Previous Thread: need help with php scripts
- Next Thread: Music library
| Thread Tools | Search this Thread |
.htaccess ajax apache api array beginner binary broken buttons cakephp checkbox class cms code cron curl database date directory display download dynamic ebooks echo email error file files folder form forms function functions google href htaccess html image include insert integration ip java javascript joomla limit link login loop mail mediawiki menu mlm mod_rewrite multiple mysql number oop paypal pdf php phpincludeissue phpmyadmin problem query radio random recursion regex remote script search server sessions sms soap source sp space speed sql subdomain syntax system table tag tutorial update upload url validation validator variable vbulletin video web websphere white xml youtube





