We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 48305
    • 58 Posts
    But i need also user_id as well as user_name cause i want to add in table both user_id and user_name.. That why i put both query...



    Quote from: Bruno17 at Jul 21, 2014, 02:43 AM
    try

    @SELECT `user_name` AS `name` FROM `[[+PREFIX]]useraccounts` 


      • 4172
      • 5,888 Posts
      well, then, just having the id should be fine.
      you can allways get the username, by doing a query to your table.
        -------------------------------

        you can buy me a beer, if you like MIGX

        http://webcmsolutions.de/migx.html

        Thanks!
        • 48305
        • 58 Posts
        Then i will show user_name in backend as i sent to an img in previous posts printing id not name in table view



        Quote from: Bruno17 at Jul 21, 2014, 03:03 AM
        well, then, just having the id should be fine.
        you can allways get the username, by doing a query to your table.
          • 4172
          • 5,888 Posts
          again, first you should create a xpdo-schema of your table(s).
          This will make further things easier.

          you will need an extra field, you can call it 'renderusername'
          put that field as a new column to the grid with the renderer this.renderChunk
          and have a snippet in the renderChunk Tpl

          which can be something like

          [[getMyUserfield? &field=`username` &id=`[[+hereTheNameOfYourUseridField]]`]]


          the snippet getMyUserfield needs to be created first, of course.
            -------------------------------

            you can buy me a beer, if you like MIGX

            http://webcmsolutions.de/migx.html

            Thanks!
            • 48305
            • 58 Posts
            Then i will show user_name in backend as i sent to an img in previous posts printing id not name in table view



            Quote from: Bruno17 at Jul 21, 2014, 03:03 AM
            well, then, just having the id should be fine.
            you can allways get the username, by doing a query to your table.
              • 48305
              • 58 Posts
              How i create new schema in current package? May it will overwrite by given schema of that specific package?

                • 4172
                • 5,888 Posts
                what is your current xpdo-schema?

                the table-name was modx_useraccounts?
                  -------------------------------

                  you can buy me a beer, if you like MIGX

                  http://webcmsolutions.de/migx.html

                  Thanks!
                  • 48305
                  • 58 Posts
                  No. tbl_useraccounts, and columns are
                  1) user_id
                  2) user_name
                  3) user_email
                  4) user_status
                  5) user_telephone
                  6) date_time