Forums

Table Value - Pass to page DB Read

msreyes 24 Sep, 2021
I have created a table and read values into is fine. Then I add a checkbox to "commit-choice"... set value to 1.

When I do my next DB read from this, how do I get the [truck] and [compartment] passed to the next DB read? I have tried everything I can think of like {var:OUTSTANDING.0.truck} , {data:truck}, etc.... no luck. And it woudl be nice to only pass the row that
[commit-choice] => 1
Array
(
    [option] => com_chronoforms6
    [cont] => manager
    [chronoform] => truck-checklist
    [event] => ITEM
    [OUTSTANDING] => Array
        (
            [0] => Array
                (
                    [truck] => P1
                    [compartment] => DRIVERS
                    [commit-choice] => 1
                )

            [1] => Array
                (
                    [truck] => R1
                    [compartment] => DOOR
                    [commit-choice] => 
                )

        )

    [button890] => 
    [COMPLETED] => Array
        (
            [0] => Array
                (
                    [truck] => P1
                    [compartment] => PASSENGER
                )

            [1] => Array
                (
                    [truck] => R1
                    [compartment] => DOOR
                )

        )

    [bigreload] => 
    [4cf5ea4485a079c8a79e8447e8b7b2a3] => d6b7b1b5ec03c6fd2ba7672a81558f69
    [gcb] => Array
        (
            [0] => 1
        )

    [tvout] => view
)
Array
(
    [ITEM_validate_fields] => Array
        (
            [log] => Automatic validation enabled.
            [var] => 1
        )

    [read_data12] => Array
        (
            [log] => Array
                (
                    [0] => SELECT `Data47`.`aid` AS `Data47.aid`, `Data47`.`item` AS `Data47.item` FROM `sometable` AS `Data47` WHERE `Data47`.`truck` = '' AND `Data47`.`compartment` = '' LIMIT 100;
                )

            [var] => Array
                (
                )

        )

)
GreyHead 26 Sep, 2021
Hi reyes,

I'm not sure that I understand your question correctly :-(

If you want to select only the array entry where commit_choice = 1 then I would probably use PHP to loop through the array and remove all the other entries (or copy the selected one to a new array).

Bob
You need to login to be able to post a reply.

VPS & Email Hosting 20% discount

{item:title} {images:#}