• Resolved quarlton

    (@quarlton)


    I’m trying to get a count of the number of rows in a table.

    If I enter the following in the SQL pane it works as expected:
    select COUNT(ID)
    from tng_people
    lastname;

    However when I try to replicate in Publication:
    Table: tng_people
    Column: COUNT(ID)

    This just gives the result pane saying ‘Processing’

    I’m obviously doing something wrong.
    Can anyone help please?
    [Note: I’m using the free version]

Viewing 3 replies - 1 through 3 (of 3 total)
  • charlesgodwin

    (@charlesgodwin)

    WPDA, PHP and MySql have issues with some special characters. I deal with it by avoiding anything except A-Z (both cases) and ‘_’ (underscore)

    Try changing your select count(ID) to select count(ID) as count_ID
    and your column in publication to count_ID

    Thread Starter quarlton

    (@quarlton)

    Many thanks for the reply Charles.

    Unfortunately the Free version of the plugin doesn’t include Premium Data Publisher, so I am restricted to just being able to use the Publisher.

    It sounds as though you can only select standard columns without any bells and whistles.

    Actually I’ve just had a lightbulb moment thanks to working through your suggstion. I can create a View and then use the Publication to pick the value from there. Tried it and it worked.

    Thanks again.

    Plugin Contributor Kim L

    (@kimmyx)

    Awesome~ Thank you @charlesgodwin for pushing @quarlton in the right direction!

    I’ll mark this thread as resolved now.

    Feel free to create a new one if you have new questions. ??

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How to do COUNT() in Publication’ is closed to new replies.