Skip to Content Skip to Menu

🌲 Merry Christmas! Great savings on Professional and Developer Memberships! Get 25% off now with code XMAS-2024!

MySQL Field Type Plugin

12 years 10 months ago - 12 years 10 months ago #190545 by pepperstreet
Replied by pepperstreet on topic Re: MySQL Field Type Plugin
I am not a SQL pro... but doesn't "CONCAT" just allow 2 arguments? There is another syntax for multiple... please have a look here .
Last edit: 12 years 10 months ago by pepperstreet. Reason: link added

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

  • nant
  • nant
  • OFFLINE
  • Posts: 12339
  • Thanks: 1467
  • Karma: 877
12 years 10 months ago #190562 by nant
Replied by nant on topic Re: MySQL Field Type Plugin

pepperstreet wrote: I am not a SQL pro... but doesn't "CONCAT" just allow 2 arguments? There is another syntax for multiple... please have a look here .


from your link!

CONCAT(string1, string2, string3, ...)

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

12 years 10 months ago - 12 years 10 months ago #190565 by 3cellhosting
Replied by 3cellhosting on topic Re: MySQL Field Type Plugin
Thanks for replies :)

We found the solution after realising that we did not need to include AS in the code. Also, as pepperstreet pointed out, CONCAT only needed two arguments. Fortunately the client only wanted a mean average. So in case this helps others, here is the final code we used, and it works perfectly...

SELECT CONCAT(DATE_FORMAT(FROM_UNIXTIME(date_submitted),'%d/%m/%Y'),' - ',(ROUND(((score_a+score_b+score_c+score_d+score_e+score_f+score_g)/7),2)))
FROM rms_ind_scores
WHERE username = {USERID} AND rms_ind_scores.storeid IN (SELECT DISTINCT store_id FROM rms_users LEFT JOIN rms_user_usergroup_map ON rms_users.id = rms_user_usergroup_map.user_id LEFT JOIN rms_clients ON rms_user_usergroup_map.group_id = rms_clients.usergroups_id LEFT JOIN rms_stores ON rms_clients.client_id = rms_stores.client_id WHERE rms_user_usergroup_map.user_id = {VIEWERID} AND store_id IS NOT NULL)
ORDER BY date_submitted DESC
LIMIT 0, 3

Thanks for the help B)

David
www.3cellhosting.com - where personality, creativity and integrity come as standard.
Last edit: 12 years 10 months ago by 3cellhosting.

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

12 years 10 months ago #190615 by akasharkbow
Replied by akasharkbow on topic Re: MySQL Field Type Plugin
This plug-in looks amazing. I've been trying to get it running on my site, with no success - the field does not even show.

Does anyone know if it works with CB 1.7.1? (I assume it does since this thread is still so active - but confirmation would help me persist here!)

Thanks :)

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

12 years 10 months ago #190618 by 3cellhosting
Replied by 3cellhosting on topic Re: MySQL Field Type Plugin
Hi there,

The site I am using it on is 1.7.3

Hope this helps 8)

David
www.3cellhosting.com - where personality, creativity and integrity come as standard.

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

12 years 10 months ago #190623 by akasharkbow
Replied by akasharkbow on topic Re: MySQL Field Type Plugin
Thanks! Sorry - I should have been more clear. I'm on Joomla 1.5, CB 1.7.1.

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

Moderators: beatnantkrileon
Powered by Kunena Forum