• Resolved nici-

    (@nici-2)


    Hiho,

    I need to connect data that I will store in a seperate table in the WordPress database. This is data which shows “monthly counts”. So every month there will be a new row added with the count data from the latest month.
    For example:

    bikes | cars | pedestrian
    202001 3 | 18 | 201
    202002 4 | 20 | 99

    With every month getting a new row added.

    I found out that I can connect a database when using the developer version. So far so good.

    My question is: To always have the “latest row” adressed (or the three latest, whatever), I cannot connect to a “given” table row. I would need to adress the data through SQL like SORT plus LIMIT. I want to show the data through calculated fields in sorted tables/overviews an perhaps also do some calculations.

    Question: Is this possible or how would a solution for this problem would look like?

    Thanks for your input.

    Best regards,
    nici-

Viewing 1 replies (of 1 total)
  • Plugin Author codepeople

    (@codepeople)

    Hello @nici-2

    Yes of course, that’s possible, you can tick the “Custom query” attribute in the DS fields for entering a custom query. For example, assuming your table’s name is: my_table, and you want the newest three rows, sorted by the “month” column, and you are using a Recordset DS field. In the case of RecordSet DS field you don’t need to tick the “Custom query” option, because the queries must be entered directly. Insert the RecordSet DS field in the form, and enter the query as follows:

    
    SELECT * FROM my_table ORDER BY month DESC LIMIT 3
    

    For additional questions about the commercial features of the plugin, you should contact us through our private website: Contact Us

    Best regards.

Viewing 1 replies (of 1 total)
  • The topic ‘SQL in DB Connection’ is closed to new replies.