Skip to content

Instantly share code, notes, and snippets.

@silentworks
Forked from anonymous/gist:976609
Created May 17, 2011 14:48
Show Gist options
  • Save silentworks/976615 to your computer and use it in GitHub Desktop.
Save silentworks/976615 to your computer and use it in GitHub Desktop.
$rels = $this->db->select('rel_parent')->where('rel_child', $userid)->where('rel_type', 'favourite')->from('content_relationships')->get();
$content_ids = '';
$i = 0;
foreach ($rels->result_array() as $row)
{
if($rels->num_rows() === $i)
{
$content_ids .= $row['rel_parent'];
}
else
{
$content_ids .= $row['rel_parent'] . ',';
}
$i++;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment