I'm a total newbie to sql. I'm trying to pull through ALL the records that correspond with the shop code, but for some reason sql is only showing me the most recent. There code i'm using is
$currentShopID = 467;
$sql = 'SELECT events.shopID AS ShopID, events.eventID AS EventID
FROM db1.events AS events
WHERE events.shopID IN ('.$currentShopID.')';
There are 10 records from shopID 467 but it is only showing the most recent one?
Update: Here is all the code from the function
function loadSomeOtherStuff($sids) {
$currentShopID = implode(',', $sids);
$sql = 'SELECT events.shopID AS ShopID, events.eventID AS EventID
FROM db1.events AS events
WHERE events.centreid IN (' . $currentShopID . ')';
$this->_db->setQuery($sql);
$event = $this->_db->loadAssocList();
if (is_null($event)) {
throw new Exception($this->_db->getErrorMsg());
}
foreach($event as $row) {
$this->_dataBySid[$row['ShopID']]['Events']['Shop Code'] = $row['ShopID'];
$this->_dataBySid[$row['ShopID']]['Events']['Events'] = $row['EventID'];
}
}