I have a query that looks for videos with a certain groupid
and returns the result. In this result I need to find the position of a certain $vid_id
:
function getGroupVidPos($id,$vid_id)
{
global $db;
$result = $db->query("SELECT * FROM videos WHERE `groupid`='$id' ORDER BY date DESC");
$a = $db->fetch($result);
return $a;
}
Can I do this in the MySQL statement it self? Or better use array_search
? Or any other ideas?