use of WHERE in the MultiRecord Load Action

kalkal 27 Mar, 2014
Hi,
how I should write the WHERE statement?
I use the below:

'email_1'='email_ait_hid'

where the email_1 is variable and email_ait_hid is field of the table.

Also whatever use or not db field, in the end appears the tags of the fields I want but not the records

Thank you.
GreyHead 27 Mar, 2014
Answer
Hi Kalkal,

The syntax of a MySQL WHERE clause is the other way round: `col_name` = 'value' (note the quotes too) so you would need to add something like:
`email_ait_hid` = '<?php echo $form->data['']; ?>'

Bob
GreyHead 27 Mar, 2014
Hi Kalkal,

Please see this FAQ It is for CFv4 but should still work with CFv4.

Bob
kalkal 27 Mar, 2014
Hi Bob,
The results are the same.
With the use of debug I found no records with `col_name` = 'value' and all the right records with col_name = 'value'
But in the end still shows the tags of fields but not the records.
Do I have to put custom code somewere?
Thank you
kalkal 27 Mar, 2014
I've just found the MultiRecord Loader Tutorial.
I used the custom code and it works but...
It shows the records like:
eponymo name vathmos
fgsgsgsgsgs eqefqefrfre 6
hjjyuyuyu ghnhhmmdt 7
hjhjgh ghgh h 9
ngjghjg fghhghdg 4
gfhgfhfghx bbncn 9
fgdfgdfg fgdfgdsg 5
fgdfgdfg fgdfgdsg 5
gdfgfgfdg fgdfgsdgfd 7

and below of all records it shows what I'm sending with jpeg

[[> Image removed for confidentiality : GreyHead <]]
GreyHead 27 Mar, 2014
Hi Kalkal,

It looks as though you have Debug turned on.

Bob
kalkal 28 Mar, 2014
Hi Bob,
Yes I have the debugger on but why it shows the three columns (with style) and nothing below them? Shouldn't show the records right below this row?
GreyHead 28 Mar, 2014
HI Kalkal,

I've no idea, how have you set up the output list????

Bob
kalkal 28 Mar, 2014
This is the custom code on load

<br />
<table cellpadding="5" cellspacing="5" border="0">
<?php
foreach($form->data['Kz183ChronoformsNew'] as $aitimata):?>
<tr>
<td><?php echo $aitimata[eponymo];?></td>
<td><?php echo $aitimata[name];?></td>
<td><?php echo $aitimata[vathmos];?></td>
</tr>
<?php
endforeach;
?>
</table>

And this what I write in multirecord loader
dbfield=emai_ait_hid
table=kz183_chronoforms_new
request param=
modelid=
fields=eponymo,name,vathmos
where statement=email_ait_hid='<?php echo $form->data['email_1']; ?>'
enable data displayer=yes
display fields=field1:eponymo,field2:name,field3:vathmos
order fields=eponymo,name,vathmos

PS.Thank you for deleting the picture.
kalkal 31 Mar, 2014
Ok,
I set enable data displayer to No and I use Custom Code to show my data
Thanks
This topic is locked and no more replies can be posted.