Simple searching function. How?

guillegm 13 Mar, 2012
I have a form that saves data correctly into a table. I made another form to search these records. I've read these topics many times ( and but not resolve my question.
When I search only get the results in the debugger code, not in my custom code. My form actions:
My custom code:
foreach($form->data['Cercar_Accident'] as $detail):
<td>Lloc: <?php echo $detail['lloc']; ?></td>
<td>Referencia: <?php echo $detail['Ref_Policial']; ?> </td>

The action of my form is "post" because when is "get" and submit url is the same url of this form, don't display nothing.
I think the "where code" is fine because in the debugger I get the correct result and the query is good. The link of my form is this and if you search "dead" should to get results.
Why don't get the results in the "Custom code - Show results html" action?
GreyHead 13 Mar, 2012
Hi guillegm,

It looks as though the Custom Code is missing the closing endforeach;

guillegm 14 Mar, 2012
Thanks Grayhead!!!
I has 3 mistakes in my form:
-I needed to close the foreach
-The action mode of my custom code must be "Controller"
-The model id is case sensitive. In DB Multi Record loader had put "Cercar_accident" and in the custom code "Cercar_Accident".

Thanks you! 😀 😀 😀 😀
This topic is locked and no more replies can be posted.