Skip to Content Skip to Menu

[SOLVED] Plotalot and Community builder

  • imaaxx
  • imaaxx
  • OFFLINE
  • Posts: 126
  • Thanks: 11
  • Karma: 2
10 years 6 months ago #244430 by imaaxx
Replied by imaaxx on topic Plotalot and Community builder
I tired this:

SELECT COUNT(*) FROM `#__comprofiler` WHERE `cb_fieldname` = 'cb_monday'

I get this error:

Plotalot error: Plot 1: Unknown column 'cb_fieldname' in 'where clause' [1054]

Hope that helps.

Please Log in or Create an account to join the conversation.

  • nant
  • nant
  • OFFLINE
  • Posts: 12339
  • Thanks: 1467
  • Karma: 877
10 years 6 months ago #244439 by nant
Replied by nant on topic Plotalot and Community builder

imaaxx wrote: I tired this:

SELECT COUNT(*) FROM `#__comprofiler` WHERE `cb_fieldname` = 'cb_monday'

I get this error:

Plotalot error: Plot 1: Unknown column 'cb_fieldname' in 'where clause' [1054]

Hope that helps.


Kyle gave this as an example - you need to substitute cb_fieldname with the fieldname you want to search by.

SO if you have a CB field titled 'Day of the week' with a field name cb_dayofweek that contains potential values of Monday, Tuesday, etc., your query WHERE clause would look like:

WHERE `cb_dayofweek` = 'Monday'

if you want to count all users that have Monday selected in this field.

Strongly suggest that you use phpmyadmin to test your query before using it elsewhere.

Please Log in or Create an account to join the conversation.

  • imaaxx
  • imaaxx
  • OFFLINE
  • Posts: 126
  • Thanks: 11
  • Karma: 2
10 years 6 months ago #244445 by imaaxx
Replied by imaaxx on topic Plotalot and Community builder
Thanks for the help with this, the thing is we have 7 fields for the days of the week, each one is named:

cb_monday, cb_tuesday , cb_wednesday and so on and they can either have a yes or no for those fields. Will this work? and how would i configure the string for fields like this.

Thanks

Please Log in or Create an account to join the conversation.

  • nant
  • nant
  • OFFLINE
  • Posts: 12339
  • Thanks: 1467
  • Karma: 877
10 years 6 months ago #244448 by nant
Replied by nant on topic Plotalot and Community builder

imaaxx wrote: Thanks for the help with this, the thing is we have 7 fields for the days of the week, each one is named:

cb_monday, cb_tuesday , cb_wednesday and so on and they can either have a yes or no for those fields. Will this work? and how would i configure the string for fields like this.

Thanks


Depends on what you want as end result.

Maybe explain what you want first?

Please Log in or Create an account to join the conversation.

  • imaaxx
  • imaaxx
  • OFFLINE
  • Posts: 126
  • Thanks: 11
  • Karma: 2
10 years 6 months ago - 10 years 6 months ago #244450 by imaaxx
Replied by imaaxx on topic Plotalot and Community builder
Hello,

I want to use this data to create a bar graph with the 7 days of the week that will display how many members have selected availability ("Yes" response) for the given days of the week. Since this is important for the site owner to be aware of the days of the week the members are most available.

Hope that helps explain what im after.

Thanks for all your help

Alan
Last edit: 10 years 6 months ago by imaaxx.

Please Log in or Create an account to join the conversation.

  • imaaxx
  • imaaxx
  • OFFLINE
  • Posts: 126
  • Thanks: 11
  • Karma: 2
10 years 6 months ago - 10 years 6 months ago #244451 by imaaxx
Replied by imaaxx on topic Plotalot and Community builder
OK i think i might be getting closer now, here is what i have created:
Code:
SELECT COUNT(*) FROM `#__comprofiler` WHERE `cb_monday`='YES' UNION SELECT COUNT(*) FROM `#__comprofiler` WHERE `cb_tuesday`='YES' UNION SELECT COUNT(*) FROM `#__comprofiler` WHERE `cb_wednesday`='YES' UNION SELECT COUNT(*) FROM `#__comprofiler` WHERE `cb_thursday`='YES' UNION SELECT COUNT(*) FROM `#__comprofiler` WHERE `cb_friday`='YES' UNION SELECT COUNT(*) FROM `#__comprofiler` WHERE `cb_saturday`='YES' UNION SELECT COUNT(*) FROM `#__comprofiler` WHERE `cb_sunday`='YES'

And im not getting any SQL errors at this time, i only get this error:

Plotalot error: This chart requires 2 columns

and for the life of me i cant figure out what to do to get this working.

Thanks for all your help so far.

Alan
Last edit: 10 years 6 months ago by imaaxx.

Please Log in or Create an account to join the conversation.

Moderators: beatnantkrileon
Powered by Kunena Forum