Show records from multi select menu

4 posts by 2 authors in: Forums > CMS Builder
Last Post: October 21, 2008   (RSS)

Re: [ryan_dot] Show records from multi select menu

By Dave - October 20, 2008

Hi ryan_dot,

What's the name of the field in the 'developments' table that has the agents values in it? Can you print out the value of that field and post it. Try some code like this, except with the correct fieldname:

<xmp><?php print_r($developmentsRecords['agents']); ?></xmp>

The first step is determining what values we have. Then figuring out how to turn it into a where query.
Dave Edis - Senior Developer
interactivetools.com

Re: [Dave] Show records from multi select menu

By Ryan - October 21, 2008

Hi Dave, found a post on the forum where you answered this before, spent hours looking yesterday with no joy and it was near the first post i found today.

Thanks,

http://www.interactivetools.com/forum/forum.cgi?post=63527

This is the code i used

// get where
$recordNumbersArray = getListValues('developments', 'agents', $developmentsRecord['agents']);
$recordNumbersAsCSV = join(', ', $recordNumbersArray);
if (!$recordNumbersAsCSV) { $recordNumbersAsCSV = "0"; }

// prevent error from having empty string if no matches
// load all records
list($estate_agentsRecords, $estate_agentsMetaData) = getRecords(array(
'tableName' => 'estate_agents',
'allowSearch' => '0',
'where' => "num IN ($recordNumbersAsCSV)",

));

Re: [ryan_dot] Show records from multi select menu

By Dave - October 21, 2008

Hi Ryan,

Glad you got it sorted out! Let me know if you need anything else. :)
Dave Edis - Senior Developer
interactivetools.com