Problem with this is that I need to be able to specify the userids ...
IE: there are 4 matches in LINKID between userid-A and userid-B
Where would I specify those in this example?
--------------- Added [DATE]1208335849[/DATE] at [TIME]1208335849[/TIME] ---------------
Code:
$sql="SELECT linkid, userid FROM links_favorites WHERE userid=1083";
$result = mysql_query($sql);
$number1 = mysql_fetch_array($result);
$sql2="SELECT linkid, userid FROM links_favorites WHERE userid=1";
$result2 = mysql_query($sql2);
$number2 = mysql_fetch_array($result2);
$result3 = array_intersect($number1, $number2);
$joined = count($result3);
echo $joined;
Also doesn't work.
--------------- Added [DATE]1208335899[/DATE] at [TIME]1208335899[/TIME] ---------------
Code:
$sql="SELECT linkid FROM links_favorites WHERE userid=1083";
$result = mysql_query($sql);
$number1 = mysql_fetch_array($result);
$myids=implode(",", $number1);
$sql2="SELECT COUNT(linkid) as count FROM links_favorites WHERE userid=1 AND linkid IN (".$myids.")";
$result2 = mysql_query($sql2);
$number2 = mysql_fetch_array($result2);
Also doesn't work.
--------------- Added [DATE]1208337252[/DATE] at [TIME]1208337252[/TIME] ---------------
Code:
$fandom = $vbulletin->db->query_read("SELECT *
FROM links_favorites AS links_favorites
LEFT JOIN links_favorites AS favs2 ON (links_favorites.linkid=favs2.linkid)
WHERE links_favorites.userid=".$vbulletin->userinfo['userid']."
AND favs2.userid=".$friend[userid]."
");
$joined= $db->num_rows($fandom);
I think this works ..... ugly.