• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Active records - "smart" select

#11
[eluser]vitoco[/eluser]
yes it is, it's not very elegant, but it works
Code:
// http://sqlfiddle.com/#!2/444e5/17

Saludos

#12
[eluser]ibnclaudius[/eluser]
But this is not what I want. I need to select the communities the user MAY want to follow. So how I do select the communities that probably interest the user? I select all users from the communities he follows and check the most common communities they follow that I don't have.

I did it:
Code:
http://sqlfiddle.com/#!2/c501e/37/0

The problem is that it returns only communities that there's a user that follow another community as me. I want to show all communities that I don't follow, ordered by this "probably interest".


#13
[eluser]vitoco[/eluser]
It's ready

Code:
// http://sqlfiddle.com/#!2/444e5/17

Saludos

#14
[eluser]vitoco[/eluser]
so ??

#15
[eluser]CodeIgniteMe[/eluser]
Still no updates?

#16
[eluser]ibnclaudius[/eluser]
Sorry for the wait. Still not that, you are only selecting and ordering the communities by the number of followers it has. I want to suggest communities that a user may want to follow.

For example:

Communities: 1,2,3,4,5,6,7,8,9,10,11,12,13,14

User A follows: 1,2,3,10,11,12,13,14

User B follows: 1,2,4,10,11,12,13,14

User H follows: 1,4,8

User C follows: 5,6,7
User D follows: 5,6,7
User E follows: 5,6,7
User F follows: 5,6,7
User G follows: 5,6,7
User I follows: 5,6,7
User J follows: 5,6,7

Let's suggest the user A the the communities he may want to follow ordered by this "may" param, in this case would be:

4,8,5,6,7,9

I've done part of it. The problem is that it doesn't return communities that hasn't at least one user that follow another community as user A. In this case, my query would return only:

4,8

SQL Fiddle:
http://bit.ly/MF9Lve


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2019 MyBB Group.