Where to check for matches and filter out
Take a look at this recipe in my CMSB Cookbook.
It might help.
Take advantage of a free 3 month trial subscription, only for CMSB users, at: http://www.thecmsbcookbook.com/trial.php
A very handy CMSB function for making properly escaped "where" statements is mysql_escapef(). In this case, you would use it like this:
'where' => mysql_escapef('floor_plan = ?', $floor_plansRecord['num']),
Try that out and let me know if it does the trick.
A note on usage: mysql_escapef() replaces the "?" in the string with the value provided. It can also handle additional values by adding more "?" characters, and each one will be replaced in sequence. For example:
mysql_escapef('one = ? AND two = ? AND three = ?', $one, $two, $three)