Forums

DB Multi Record Loader

oGladiatore 10 Mar, 2013
Hi,
I apologize in advance because it seemed to me that this question I am about to make has already been discussed, but I did not understand very well. I'm using a translator so sorry if I write badly.

I am using ChronoForms over for the realization of forms for data entry also to perform search queries.
My problem is just the query.

I have a table with fields that do not belong to chronoform but always part of the same database. I created a form "DB Multi Record Loader" and select the table you want to operate.
I need to choose on the basis of the conditions some of the records in this table.

For example, if in this table there are fields "toy", "date" where toy can take values ​​"yes", "no" and the date just a field calendar.

I would like to select only toys with which you have a date xo which is located in an interval of time that will establish in relation to that date.

Should I put the conditions in where statement? If you in that way?

thanks in advance.
oGladiatore 11 Mar, 2013
on "where statement" I set a condition and "order fields" fields that I want to display. First, however, I put some fields that now I do not need any more, even if I took them off and saved in the output appear equally. Why is that?
GreyHead 11 Mar, 2013
Hi oGladiatore,

Yes, you should use the Where box. The code in there should return a valid MySQL WHERE expression to filter the results. You can use PHP to include results from any filter form on your listing.

Bob
oGladiatore 11 Mar, 2013
thanks for the reply, but where do I put the php code to set filters selectable from front end to generate a query?
I also tried a condition like this:

occupato_dal> = '2013 / 03/11 '
and libero_al <= '2013 / 05/20 '

but do not get results. With this query I get all the fields that are in the range of these dates
GreyHead 11 Mar, 2013
Hi oGladiatore,

The Form results will be in the $form->data array e.g. $form->data['some_date_input'], you will need to make sure that the date formats match with the formats of the saved data.

Adding a Debugger action temporarily to the On Submit event will let you see what is in the $form->data array when the form is submitted.

Bob
This topic is locked and no more replies can be posted.