In one of my controllers I have:
function TipsByCategory()
{
if(isset($_GET['id']))
{
$tips = DataObject::get('Tip', "tip_categories.CategoryID = $_GET[id]", '', "LEFT JOIN tip_categories ON tip.ID = tip_categories.TipID");
return $tips;
}
}
But this doesn't seem to be working in the 'live' site. I figured out by the errors and looking in the database that for the 'live' site I had to use
ON tip_live.ID = tip_categories.TipID
instead of
ON tip.ID = tip_categories.TipID
Now I'm probably doing this the wrong way... any ideas?