Welcome Guest, Not a member yet? Register   Sign In
Active records - "smart" select
#1

[eluser]ibnclaudius[/eluser]
I have three tables: users(id,name), users_communities(user_id,community_id), communities(id,name)

I know how to select the communities the user doesn't have, but I want a more efficient result...

Here's my idea, I'll show an example.

User A has these communities:
PHP,JAVA,ORACLE

User B:
PHP,MYSQL,JAVASCRIPT

User C:
PHP,CODEIGNITER,SOCCER

User D:
PHP,CODEIGNITER,MYSQL

Let's say I want to show to user A the top 2 communities he may want. In this case would be CODEIGNITER and MYSQL.

What I did?
Select all common users in communities that I have.
Select the 2 most common communities in these users.

I'm pretty sure that should be something much more complex, but this is the beginning...


Messages In This Thread
Active records - "smart" select - by El Forum - 06-15-2012, 12:22 PM
Active records - "smart" select - by El Forum - 06-15-2012, 09:41 PM
Active records - "smart" select - by El Forum - 06-15-2012, 09:47 PM
Active records - "smart" select - by El Forum - 06-15-2012, 09:59 PM
Active records - "smart" select - by El Forum - 06-15-2012, 09:59 PM
Active records - "smart" select - by El Forum - 06-15-2012, 10:00 PM
Active records - "smart" select - by El Forum - 06-15-2012, 10:21 PM
Active records - "smart" select - by El Forum - 06-15-2012, 10:51 PM
Active records - "smart" select - by El Forum - 06-15-2012, 10:57 PM
Active records - "smart" select - by El Forum - 06-15-2012, 10:59 PM
Active records - "smart" select - by El Forum - 06-15-2012, 11:07 PM
Active records - "smart" select - by El Forum - 06-15-2012, 11:30 PM
Active records - "smart" select - by El Forum - 06-16-2012, 12:04 AM
Active records - "smart" select - by El Forum - 06-20-2012, 06:48 PM
Active records - "smart" select - by El Forum - 06-20-2012, 10:20 PM
Active records - "smart" select - by El Forum - 06-23-2012, 07:54 AM



Theme © iAndrew 2016 - Forum software by © MyBB