Reversing Concatenation?

8 posts by 3 authors in: Forums > CMS Builder
Last Post: November 6, 2014   (RSS)

By Damon - October 27, 2014

Hi Jerry,

What about putting the dates and emails into an array and then using the array_reverse function?

http://php.net/manual/en/function.array-reverse.php

Cheers,
Damon Edis - interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/

Thanks for looking at this, Damon,

Sounds like a good idea, but I'm not sure how to put the groups into an array.

All sets start with a date, have a number of emails separated by commas, and end with an asterisk (or another character if that works better).

Jerry Kornbluth

The first CMS Builder reference book is now available on-line!







Take advantage of a free 3 month trial subscription, only for CMSB users, at: http://www.thecmsbcookbook.com/trial.php

By Damon - October 28, 2014

Can you give me an example of the date, emails output?

And also how you are going to use them?

The reason I ask is that I'm wondering if the date, email string can be put into an array as a single variable or as separate variables?

Cheers,
Damon Edis - interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/

Hi Damon,

An example of the final date, email output in the 'links_sent_dates_and_emails' field in the accounts table record is:

After the first order:

10-27-14 7:40:34 am: jerry@thecmsbcookbook.com, cookbook@thecmsbcookbook.com, jerry@jkwebdesigns.com *

After the second order (notice that the newest entry is last):

10-27-14 7:40:34 am: jerry@thecmsbcookbook.com, cookbook@thecmsbcookbook.com, jerry@jkwebdesigns.com * 10-27-14 8:07:35 am: jerry@thecmsbcookbook.com, cookbook@thecmsbcookbook.com, jerry@jkwebdesigns.com *

______________________________

An example of the final date, email output in the report viewer is:

After the first order:

10-27-14 7:40:34 am: jerry@thecmsbcookbook.com, cookbook@thecmsbcookbook.com, jerry@jkwebdesigns.com

After the second order (notice that the newest entry is at the bottom):

10-27-14 7:40:34 am: jerry@thecmsbcookbook.com, cookbook@thecmsbcookbook.com, jerry@jkwebdesigns.com

10-27-14 8:07:35 am: jerry@thecmsbcookbook.com, cookbook@thecmsbcookbook.com, jerry@jkwebdesigns.com

______________________________

Thanks,

Jerry Kornbluth

The first CMS Builder reference book is now available on-line!







Take advantage of a free 3 month trial subscription, only for CMSB users, at: http://www.thecmsbcookbook.com/trial.php

By Dave - November 5, 2014

Hi Jerry, 

What about swapping this:  CONCAT(links_sent_dates_and_emails, '$sent_dates_and_emails'),

With this:  CONCAT('$sent_dates_and_emails', links_sent_dates_and_emails),

Would that work for you? 

Dave Edis - Senior Developer
interactivetools.com

Thanks Dave,

I'll give it a try in the morning.

It would be nice if turned out that it was that easy...

Jerry Kornbluth

The first CMS Builder reference book is now available on-line!







Take advantage of a free 3 month trial subscription, only for CMSB users, at: http://www.thecmsbcookbook.com/trial.php

Hi Dave,

It seems that sometimes we can't see the forest because the trees get in the way.

Your simple solution worked perfectly, and now the latest entry is at the beginning of the list.

As always, a large debt of gratitude.

Best,

Jerry Kornbluth

The first CMS Builder reference book is now available on-line!







Take advantage of a free 3 month trial subscription, only for CMSB users, at: http://www.thecmsbcookbook.com/trial.php