display multiple records

9 posts by 3 authors in: Forums > CMS Builder
Last Post: November 25, 2010   (RSS)

Re: [Dan Maitland] display multiple records

Hi Dan.

Great looking site!

Is it the "'limit' => 1," causing the problem?
Cheers,

Tim (toledoh.com.au)

Re: [Toledoh] display multiple records

That what I thought at first butevenafter changing it or even removing it it still won't display more than one agent at a time. I think it has something to do with an "array" but I'm not really sure.

Re: [Dan Maitland] display multiple records

Didn't think it would be that simple :)
Cheers,

Tim (toledoh.com.au)

Re: [Dan Maitland] display multiple records

By Jason - November 25, 2010

Hi Dan,

What type of field is $suiteRecord['agent']? Is it a multi-select checkbox field?

If it is, it's storing multiple agent numbers as a string separated by tab characters (\t). You can break it up and use it in your code like this:


$agentNums = str_replace("\t",",",trim($suiteRecord['agent'],"\t"));
if(!$agentNums){$agentNums = 0;}

list($agentsRecords, $agentsMetaData) = getRecords(array(
'tableName' => 'agents',
'allowSearch' => false,
'where' => "num IN (".mysql_escape($agentNums).")",
));


You would need to remove the limit=1 either way you'd only ever return one record anyway.

Give this a try and let me know if you run into any other problems.

Hope this helps.
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/

Re: [Jason] display multiple records

They are check boxes.

Re: [Dan Maitland] display multiple records

By Jason - November 25, 2010

Hi Dan,

What are the names of the agent check boxes you're using?
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/

Re: [Jason] display multiple records

agent

Re: [Dan Maitland] display multiple records

By Jason - November 25, 2010

Hi,

Please send in a [url http://www.interactivetools.com/support/]2nd Level Support Request[/url] so I can go in and take a closer look at what's happening.

Thanks
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/