We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 42653
    • 1 Posts
    Quote from: Neatoman at Jan 05, 2013, 10:44 AM
    Hey guys. I could use a little help here. Is there a way to get Rowboat to return only distinct fields? Basically, to run a SELECT DISTINCT query instead of just SELECT?

    This should do it:

    [[!Rowboat?
        &tpl=`yourTpl`
        &table=`[[++table_prefix]]site_content`
        &limit=`0`
        &columns=`{"DISTINCT YEAR( FROM_UNIXTIME( publishedon ) ) ":"year"}`
    ]]
    
      • 30912
      • 463 Posts
      Hi All,

      I'm havign some trouble with rowboat, apart from needing to sort a snippet to take the id from a previous page which is another issue i cannot for the life of me set the plaeholders from the database.

      my call is

      [[!Rowboat?
         &table=`as_table`
         &limit=`1`
         &where=`{"id:LIKE":"3"}`
        &debug=`1`
      ]]


      This works fine, outputs the debug array and the array in the page but as soon as i set

      [[!Rowboat?
         &table=`as_table`
         &limit=`1`
         &where=`{"id:LIKE":"3"}`
      &toPlaceholder=`1`
        &debug=`1`
      ]]


      and use for example the placeholder of [[+rowboat.make]] (the column exists) I get nothing, no display or debug params, any ideas what im missing?

      Thanks [ed. note: Tyreal2012 last edited this post 11 years ago.]
        • 28099
        • 39 Posts
        I just found this plugin and it seems like it is everything that I need to retrieve data from a list of doctors and their information. I just simply need to be able to filter Doctors by location, specialty, etc.

        My issue is that it is returning nothing. If i set debug to 1, then it does list the table information.

        [[!Rowboat?
           &table=`doctorList`
           &tpl=`docResults`
           &limit=`10`
           &sortBy=`lname`
           &debug=`0`
        ]]
         
        docResults:
        <li id="docResults[[+id]]"><strong>[[+fname]] [[+lname]]</strong> - [[+specialty]]</li>
        


        If I can get this work then I should be golden. Otherwise I need help accomplishing these simple queries. Could not find another plugin or tutorial. MY DB experience is limited at best. It's been a long time since I had to make DB queries so all this xPDO and JSON stuff has me a bit confused.

        Any help would be greatly appreciated.

        Thanks in advance.
          • 30912
          • 463 Posts

          I used a similar query to test:

          [[!Rowboat? &table=`as_inventory` &limit=`10` &tpl=`inv_Details_Left` ]]


          That works fine for me, try it with the basic call without the sortby
            • 28099
            • 39 Posts
            Quote from: Tyreal2012 at Apr 17, 2013, 03:33 PM

            I used a similar query to test:

            [[!Rowboat? &table=`as_inventory` &limit=`10` &tpl=`inv_Details_Left` ]]


            That works fine for me, try it with the basic call without the sortby

            Awesome. It worked. Now to figure out how to sort. smiley
              • 30912
              • 463 Posts
              You need to include the table prefix.

              Your sort was correct before, its just &sortBy=`lname` (providing your column is called lname)
                • 28099
                • 39 Posts
                All good now with the exception of one thing. No one else can see it! Other people are getting a 404. Does this only work for logged in admins?
                  • 30912
                  • 463 Posts
                  Sounds daft, but is the display page published.
                    • 28099
                    • 39 Posts
                    Yeah that was it. I always forget that logged in admins can see unpublished pages.

                    Next question...

                    Can this thing be tied into a search function somehow? SimpleSearch maybe?

                      • 28099
                      • 39 Posts
                      And then the question after that will be if it will be possible to click on any of the returned doctors to view a full profile that includes all the columns in that row?