Help creating simple search form

outbreak198x 17 Sep, 2012
Hello,

I am new on Chronoforms & Chronoconnecivity - and now i need a little hint for my first project.
I now have a databasetable where i have to create a search form for a serialnumber (one row) but before that i have to select a group via drop-down menu (another row).

Now i create a form with DB Multi Record Loader - added the database table & Data Displayer.
now "on submit" it shows all rows of the table🙂 - it's nice, but how can i connect the Serialnumber (Textfield) and the Drop-Down Menu, so i can search in the table...

I found a few entries about this, but everything i tried in the moment won't work.
I think i have to add a WHERE statement, and i am a big noob @ coding😉

Maybe someone can help me
Best regards.
GreyHead 17 Sep, 2012
Hi utbreak198x,

You can set up a simple search in ChronoConnectivity using the settings on the Frontend List Settings | search Settings tag. I've put a screenshot below of the settings for the FAQ listing search box here.

Bob
outbreak198x 17 Sep, 2012
Hello and thx so far, but in that case don't have a drop down menu for the groups i have to select?

And i have to send a mail after the search - so its easier with chronoforms i think?

In the moment i get those mails from the form, the only thing is to "connect" the Serialnumberfield from search form to row in Table and the group-selection to the row in the table.

Or am i wrong?
GreyHead 17 Sep, 2012
Hi outbreak198x ,

I'm sorry I didn't' read your post well enough.

You can add a WHERE query in the DB Multi-Record Loader action like
 WHERE `column_name` = '{input_name}' 


Bob
outbreak198x 17 Sep, 2012
So the column_name is the name of the column in the database - in my case Serialnumber
the input_name is which one? - i know it's simple, but won't work
Field Name? Field ID? ord Field Title? - its not so easy for me.
GreyHead 17 Sep, 2012
Hi outbreak198x,

Field Name

Bob
outbreak198x 17 Sep, 2012
So whats my problem😟
the field name is seriennummer
the coloum is Seriennummer
WHERE string added... - no result with A240CI080
without WHERE string - all results displayed and serial is available...
outbreak198x 19 Sep, 2012
Still the same problem😟
Any solution for me greqhead?
outbreak198x 19 Sep, 2012
if i enter a number for e.g. `Seriennummer` = 'B1A240B59' in the where code it gives me the correct row.
but that doesn't work `Seriennummer` = '{Seriennummer}' - and the name of the textfield is correct.
GreyHead 23 Sep, 2012
Hi outbreak198x ,

From the image you posted the name of the form input is 'seriennummer' (and not'Seriennummer') so the WHERE SQL box code would need to be:
Seriennummer` = '{seriennummer}'


Bob



Bob
outbreak198x 23 Sep, 2012
thats correct, because i tried a few things, but none of them works correctly
tried with lower case, upper case, many things with ' and without...
GreyHead 23 Sep, 2012
Hi outbreak198x,

Then please try the PHP format:
Seriennummer` = '<?php echo $form->data['seriennummer']; ?>'


Bob
outbreak198x 24 Sep, 2012
:D Many Thanks... That works.
Maybe a last Question for this post - How can i combine more fields together?

search for
 `Seriennummer` = '<?php echo $form->data['Seriennummernfeld']; ?>'

and also search in (Drop-Down)
 `Teil-Gruppe` = '<?php echo $form->data['Teilgruppenfeld']; ?>'


it have to be a combination of both input fields.
GreyHead 24 Sep, 2012
Hi outbreak198x,

Please try
`Seriennummer` = '<?php echo $form->data['Seriennummernfeld']; ?>' AND `Teil-Gruppe` = '<?php echo $form->data['Teilgruppenfeld']; ?>'

Bob
outbreak198x 24 Sep, 2012
OK - thats simple😉
And how can i do it so that i also can search for a frame for e.g. i search for B1A and the complete word is B1A240B59 - should also be found
GreyHead 24 Sep, 2012
Hi outbreak198x,

`Seriennummer` LIKE '%<?php echo $form->data['Seriennummernfeld']; ?>%'


Please check the MySQL manual for more examples of WHERE clause syntax.

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