Forums

Please help a noob. This is probably simple.

junkyarddog 28 Apr, 2012
I am not a code guy so I'm sure this is simple. I've been searching for a solution on the forums for two days now and haven't found one. I have a form to query a database and show results. Everything works except on my multi-select and checkbox groups the results only display the last option of the array that I clicked. Thanks in advance for any assistance.

I'm using Joomla 2.5 and CF V4.

My where statement in multi record loader

`Bedrooms` = '<?php echo $form->data['bedselect']; ?>' AND `Bathrooms` ='<?php echo $form->data['bathselect']; ?>'


my debugger shows

SELECT `sqft`, `bedrooms`, `bathrooms` FROM `fpdatabase` AS `Fpdatabase` WHERE `Bedrooms` = '2' AND `Bathrooms` ='1,2'
GreyHead 29 Apr, 2012
Hi junkyarddog,

It's a MySQL problem. In the query you have `Bathrooms` ='1,2' and presumably the database table has an integer in the bathrooms column e.g. 1 or 2 or 3 or . . . so '1,2' will never match.

Please try this in the Where box:
`Bedrooms` IN (<?php echo $form->data['bedselect']; ?>) AND `Bathrooms` IN (<?php echo $form->data['bathselect']; ?>)
This should give a match if there are 1 or 2 bathrooms.

Bob
junkyarddog 29 Apr, 2012
Perfect thank you so much for your help!!
This topic is locked and no more replies can be posted.