We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 30912
    • 463 Posts
    Hello (again)

    i'm using Rowboat to display content drawn from a MIGxDb however I'm trying to create a TV which creates a multi select box based on set criteria - this works.

    However In rowboat, it will only ever pull the first item selected

    I'm not sure if Rowboat handles arrays, ive tried some of the solutions ive found on theforums but no solid answer.

    TV: Multi Select dropdown with output set to Delimiter ,

    Rowboat call

    [[Rowboat?
      &table=`modx_resourcesdb`
      &tpl=`RowBoatItem`
      &where=`{"id":"[[*testTV]]", "published":"1"}`
      &debug=`1`
    ]]
    


    This outputs the first value from the TV

    As seen in the debug here:

    Rowboat Debugging Information
    Table modx_resourcesdb
    SQL Query SELECT * FROM `modx_resourcesdb`
    WHERE `id` = "2,1" AND `published` = "1"
    LIMIT 10
    PDO Statement SELECT * FROM `modx_resourcesdb`
    WHERE `id` = :id AND `published` = :published
    LIMIT 10
    Parameters

    array (
    'id' => '2,1',
    'published' => '1',
    )

    Total 1

    If i change up the call to add in

    [[Rowboat?
      &table=`modx_resourcesdb`
      &tpl=`RowBoatItem`
      &where=`{"id:IN":"[[[*testTV]]]", "published":"1"}`
      &debug=`1`
    ]]
    


    I get nothing due to the syntax on the [[*testTV]] having the extra [ ]

    The SQL works for the arry however

    SELECT *
    FROM `modx_resourcesdb`
    WHERE `id`
    IN ( 2, 1 )
    AND `published` = "1"

    But when subsituting the actual call there is no result

    [[!Rowboat?
      &table=`modx_resourcesdb`
      &tpl=`RowBoatItem`
      &where=`{"id:IN":[2,1]}`
      &debug=`1`
    ]]
    


    2014-01-22 12:41:56] (WARN @ /var/www/vhosts/site/httpdocs/core/components/rowboat/model/rowboat/rbquery.class.php : 164) PHP notice: Array to string conversion [2014-01-22 12:41:56] (WARN @ /var/www/vhosts/site/httpdocs/core/components/rowboat/model/rowboat/rbquery.class.php : 164) PHP notice: Array to string conversion
    Rowboat Debugging Information
    Table modx_resourcesdb
    SQL Query SELECT * FROM `modx_resourcesdb`
    WHERE `id` IN "Array"
    LIMIT 10
    PDO Statement SELECT * FROM `modx_resourcesdb`
    WHERE `id` IN :id
    LIMIT 10
    Parameters

    array (
    'id' =>
    array (
    0 => 2,
    1 => 1,
    ),
    )


    Any ideas for the solution to the select TV?

    Im wondering if Rowboat just doesnt support arrays - the RTFM is somewhat limited.

    Thanks [ed. note: Tyreal2012 last edited this post 12 years, 8 months ago.]