Forums

Wildcard in DB Multi-Record Loader

tshirley 05 May, 2014
Hi again,

I have a form where I can enter a value such as Last_Name which then passes a parameter to a second form containing a Multi-Record Loader to display results. This works well if the full name is known. So if Last_Name is set to "Smith" it displays all the Smiths.

Is there a way to use a wildcard in this setup? So that I can enter for example Last_Name = "Smit*" and get all the rows with Smits and Smith and Smittington and so on? Or even a % substitution?

Also, can I use a URL parameter in the WHERE clause? .

So for example pass a second parameter "state", and then have a lookup on Last_Name and a Where 'State' = {state} filter on the returned rows? OK I know that example won't work it is just a way to indicate what I am looking for. Maybe I need custom code to achieve it.

This sort of feature would be useful to allow filtering of a table with a large number of rows.

Cheers

Tim
Max_admin 06 May, 2014
Answer
Hi Tim,

You can use any PHP in the WHERE section, which means that you can capture and use URL parameters using $form->data["param_name"]

The wildcard can be used this way:
LIKE "Smit%"


Regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
tshirley 06 May, 2014
Thanks Max,

In fact after posting I discovered Chronoconnectivity which has all the functionality I need out of the box.

Many thanks for your support, and apologies for what turned out to be an unnecessary question.

Cheers

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