Forums

Search multiple fields to get a result

cruser 26 Oct, 2020
I have fields set up for first name and last name. If I search for first name only, I get a result. If I search for last name only, I get a result. If I search for both first and last name I do not get a result. How can I search both fields?

In the read_articles function the searchable fields are:
firstname
OR
lastname

In the read_article function the searchable fields are:
firstname
OR
lastname
Max_admin 27 Oct, 2020
what are the SQL results shown in the debug ?
Max
ChronoForms developer...
Did you try ChronoMyAdmin for managing your Joomla database tables ?
cruser 27 Oct, 2020
This is what I see:
Array
(
    [conn] => inventory
    [keywords] => IEM 6808L
    [format] => html
    [Itemid] => 257
    [option] => com_chronoconnectivity6
    [view] => connection
)
Array
(
    [read_articles] => Array
        (
            [log] => Array
                (
                    [0] => SELECT COUNT(`Article`.`aid`) AS `Article.count` FROM `pka30_chronoforms_data_ncmentry` AS `Article` WHERE `Article`.`title` LIKE '%IEM 6808L%' OR `Article`.`rpm` LIKE '%IEM 6808L%' OR `Article`.`hp` LIKE '%IEM 6808L%' OR `Article`.`make` LIKE '%IEM 6808L%' OR `Article`.`framem` LIKE '%IEM 6808L%' OR `Article`.`enclosure` LIKE '%IEM 6808L%' OR `Article`.`bearings` LIKE '%IEM 6808L%' OR `Article`.`stock` LIKE '%IEM 6808L%' OR `Article`.`volts` LIKE '%IEM 6808L%' OR `Article`.`amps` LIKE '%IEM 6808L%' OR `Article`.`armature` LIKE '%IEM 6808L%' OR `Article`.`angle` LIKE '%IEM 6808L%' OR `Article`.`class` LIKE '%IEM 6808L%' OR `Article`.`dutycylce` LIKE '%IEM 6808L%' OR `Article`.`hertz` LIKE '%IEM 6808L%' OR `Article`.`fulltext` LIKE '%IEM 6808L%' OR `Article`.`servicefactor` LIKE '%IEM 6808L%' OR `Article`.`ratio` LIKE '%IEM 6808L%' OR `Article`.`shaftdiameter` LIKE '%IEM 6808L%' OR `Article`.`length` LIKE '%IEM 6808L%' OR `Article`.`phase` LIKE '%IEM 6808L%' OR `Article`.`code` LIKE '%IEM 6808L%' OR `Article`.`model` LIKE '%IEM 6808L%' OR `Article`.`design` LIKE '%IEM 6808L%' OR `Article`.`kva` LIKE '%IEM 6808L%' OR `Article`.`secondaryvolts` LIKE '%IEM 6808L%' OR `Article`.`secondaryamps` LIKE '%IEM 6808L%' OR `Article`.`serialnumber` LIKE '%IEM 6808L%' OR `Article`.`catalog` LIKE '%IEM 6808L%' OR `Article`.`style` LIKE '%IEM 6808L%' OR `Article`.`controlvolts` LIKE '%IEM 6808L%' OR `Article`.`size` LIKE '%IEM 6808L%' OR `Article`.`condition` LIKE '%IEM 6808L%' OR `Article`.`keywords` LIKE '%IEM 6808L%';
                    [1] => SELECT `Article`.`aid` AS `Article.aid`, `Article`.`user_id` AS `Article.user_id`, `Article`.`created` AS `Article.created`, `Article`.`modified` AS `Article.modified`, `Article`.`title` AS `Article.title`, `Article`.`hp` AS `Article.hp`, `Article`.`rpm` AS `Article.rpm`, `Article`.`make` AS `Article.make`, `Article`.`framem` AS `Article.framem`, `Article`.`enclosure` AS `Article.enclosure`, `Article`.`bearings` AS `Article.bearings`, `Article`.`stock` AS `Article.stock`, `Article`.`volts` AS `Article.volts`, `Article`.`fulltext` AS `Article.fulltext`, `Article`.`ambient` AS `Article.ambient`, `Article`.`amps` AS `Article.amps`, `Article`.`armature` AS `Article.armature`, `Article`.`angle` AS `Article.angle`, `Article`.`class` AS `Article.class`, `Article`.`dutycylce` AS `Article.dutycylce`, `Article`.`hertz` AS `Article.hertz`, `Article`.`servicefactor` AS `Article.servicefactor`, `Article`.`ratio` AS `Article.ratio`, `Article`.`shaftdiameter` AS `Article.shaftdiameter`, `Article`.`length` AS `Article.length`, `Article`.`phase` AS `Article.phase`, `Article`.`code` AS `Article.code`, `Article`.`model` AS `Article.model`, `Article`.`type` AS `Article.type`, `Article`.`design` AS `Article.design`, `Article`.`kva` AS `Article.kva`, `Article`.`secondaryvolts` AS `Article.secondaryvolts`, `Article`.`secondaryamps` AS `Article.secondaryamps`, `Article`.`serialnumber` AS `Article.serialnumber`, `Article`.`catalog` AS `Article.catalog`, `Article`.`style` AS `Article.style`, `Article`.`controlvolts` AS `Article.controlvolts`, `Article`.`size` AS `Article.size`, `Article`.`condition` AS `Article.condition`, `Article`.`category` AS `Article.category`, `Article`.`imageone` AS `Article.imageone`, `Article`.`imagetwo` AS `Article.imagetwo`, `Article`.`imagethree` AS `Article.imagethree`, `Article`.`keywords` AS `Article.keywords` FROM `pka30_chronoforms_data_ncmentry` AS `Article` WHERE `Article`.`title` LIKE '%IEM 6808L%' OR `Article`.`rpm` LIKE '%IEM 6808L%' OR `Article`.`hp` LIKE '%IEM 6808L%' OR `Article`.`make` LIKE '%IEM 6808L%' OR `Article`.`framem` LIKE '%IEM 6808L%' OR `Article`.`enclosure` LIKE '%IEM 6808L%' OR `Article`.`bearings` LIKE '%IEM 6808L%' OR `Article`.`stock` LIKE '%IEM 6808L%' OR `Article`.`volts` LIKE '%IEM 6808L%' OR `Article`.`amps` LIKE '%IEM 6808L%' OR `Article`.`armature` LIKE '%IEM 6808L%' OR `Article`.`angle` LIKE '%IEM 6808L%' OR `Article`.`class` LIKE '%IEM 6808L%' OR `Article`.`dutycylce` LIKE '%IEM 6808L%' OR `Article`.`hertz` LIKE '%IEM 6808L%' OR `Article`.`fulltext` LIKE '%IEM 6808L%' OR `Article`.`servicefactor` LIKE '%IEM 6808L%' OR `Article`.`ratio` LIKE '%IEM 6808L%' OR `Article`.`shaftdiameter` LIKE '%IEM 6808L%' OR `Article`.`length` LIKE '%IEM 6808L%' OR `Article`.`phase` LIKE '%IEM 6808L%' OR `Article`.`code` LIKE '%IEM 6808L%' OR `Article`.`model` LIKE '%IEM 6808L%' OR `Article`.`design` LIKE '%IEM 6808L%' OR `Article`.`kva` LIKE '%IEM 6808L%' OR `Article`.`secondaryvolts` LIKE '%IEM 6808L%' OR `Article`.`secondaryamps` LIKE '%IEM 6808L%' OR `Article`.`serialnumber` LIKE '%IEM 6808L%' OR `Article`.`catalog` LIKE '%IEM 6808L%' OR `Article`.`style` LIKE '%IEM 6808L%' OR `Article`.`controlvolts` LIKE '%IEM 6808L%' OR `Article`.`size` LIKE '%IEM 6808L%' OR `Article`.`condition` LIKE '%IEM 6808L%' OR `Article`.`keywords` LIKE '%IEM 6808L%' GROUP BY `Article.title`, `Article.rpm`, `Article.hp`, `Article.framem`, `Article.enclosure` ORDER BY `Article.hp` DESC, `Article.rpm` DESC LIMIT 30;
                )

            [var] => Array
                (
                )

        )

)
cruser 03 Nov, 2020

I think the SQL is wrong or ambiguous, you should use some brackets


Like this?

[
firstname
OR
lastname
]
Max_admin 03 Nov, 2020
no, (first OR second)

Honestly it's easy to make mistakes in v6, you better try v7 at least for this form only!
Max
ChronoForms developer...
Did you try ChronoMyAdmin for managing your Joomla database tables ?
cruser 03 Nov, 2020
I sent an email concerning a few things yesterday. It may help clarify my issue(s).
cruser 11 Nov, 2020
Max I now using CF7 but this issue still exists. I cannot search for a first name AND last name and get a result. I can only search for one or the other to get a result.
Max_admin 12 Nov, 2020
The results returned are dependent on the SQL query made, Chronoforms just translates the where conditions to a query data, what query works for you when you test this in phpmyadmin ? I can tell you how to make it in the Chronoforms admin area!
Max
ChronoForms developer...
Did you try ChronoMyAdmin for managing your Joomla database tables ?
cruser 12 Nov, 2020
Is this what you mean in phpmyadmin?
SELECT*FROM`REDACTED`.`pka30_content`WHERE(CONVERT(`id`USINGutf8)LIKE'%iem%'ORCONVERT(`asset_id`USINGutf8)LIKE'%iem%'ORCONVERT(`title`USINGutf8)LIKE'%iem%'ORCONVERT(`alias`USINGutf8)LIKE'%iem%'ORCONVERT(`introtext`USINGutf8)LIKE'%iem%'ORCONVERT(`fulltext`USINGutf8)LIKE'%iem%'ORCONVERT(`state`USINGutf8)LIKE'%iem%'ORCONVERT(`catid`USINGutf8)LIKE'%iem%'ORCONVERT(`created`USINGutf8)LIKE'%iem%'ORCONVERT(`created_by`USINGutf8)LIKE'%iem%'ORCONVERT(`created_by_alias`USINGutf8)LIKE'%iem%'ORCONVERT(`modified`USINGutf8)LIKE'%iem%'ORCONVERT(`modified_by`USINGutf8)LIKE'%iem%'ORCONVERT(`checked_out`USINGutf8)LIKE'%iem%'ORCONVERT(`checked_out_time`USINGutf8)LIKE'%iem%'ORCONVERT(`publish_up`USINGutf8)LIKE'%iem%'ORCONVERT(`publish_down`USINGutf8)LIKE'%iem%'ORCONVERT(`images`USINGutf8)LIKE'%iem%'ORCONVERT(`urls`USINGutf8)LIKE'%iem%'ORCONVERT(`attribs`USINGutf8)LIKE'%iem%'ORCONV[...]
cruser 12 Nov, 2020
The search in CF7 still does not begin on the first page for me. If I navigate away through the paginator for example to page 3 and then perform a search I either get nothing shown because there are not enough results to be on three pages (you have to click on number one page in paginator to see them) OR the results I get are the third page of results and not from the beginning. Why wouldn't it display results on the first page?
cruser 13 Nov, 2020
I've worked myself in circles and I have had to move back to CC6. What am I missing? I cannot get this search to work. If I search for a title, I get results. If I search for title AND anything else I get no results.





Max_admin 14 Nov, 2020
Could you please use v7 ?

Try to build the query in the where conditions section, what problem do you have ?

The search page bug is fixed in the next update!
Max
ChronoForms developer...
Did you try ChronoMyAdmin for managing your Joomla database tables ?
zest96 06 Dec, 2020
this will help you.
https://www.chronoengine.com/forums/posts/t108670/p393949#p393949
You need to login to be able to post a reply.