Not sure what i'm doing wrong here
two tables, DATES and SESSIONS.
DATES includes a list field that allows multiple SESSIONS to be selected - field name is related_sessions.
On the public DATES page, I'm trying to load all of the related_sessions
// load record from 'dates'
list($date, $dateMetaData) = getRecords(array(
'tableName' => 'dates',
'where' => whereRecordNumberInUrl(0),
'loadUploads' => true,
'allowSearch' => false,
'limit' => '1',
));
$date = @$date[0]; // get first record
if (!$date) { header('Location: /'); exit; }
// load records from 'sessions'
list($related_sessions, $related_sessionsMetaData) = getRecords(array(
'tableName' => 'sessions',
'where' => "num LIKE '%\t". $date['related_sessions'] ."\t%'" ,
'loadUploads' => true,
'allowSearch' => false,
));
with debug on:
SELECT SQL_CALC_FOUND_ROWS `sessions`.*
FROM `cms_sessions` as `sessions`
WHERE (num LIKE '% 1048 1047 %') AND `sessions`.hidden = 0
ORDER BY date_time DESC,location,type
Not record are returned.