Hello Kyle,
I have "looked" at the suggested documentation: dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html but have zero idea of what the heck is going on with that page.
So, I created the following query which works and returns the date and time when used in a CB query field.
Code:
select #__eb_events.event_date from #__eb_events, #__eb_registrants
where #__eb_events.id = #__eb_registrants.event_id
and #__eb_registrants.user_id = '[user_id]'
and #__eb_registrants.checked_in = 1
and #__eb_events.alias = 'LHPS'
order by #__eb_events.event_date desc
limit 1
I really want to update cb_lhps_course_date in #__comprofiler by using Auto Actions so that I can manipulate the data more easily.
I did some test code with simple update and set code in Auto Actions and had it updating the DB when the user viewed their profile and logged in.
So, I now have a query inAuto Actions:
Code:
update #__comprofiler
set cb_lhps_course_date =
[select #__eb_events.event_date from #__eb_events, #__eb_registrants
where #__eb_events.id = #__eb_registrants.event_id
and #__eb_registrants.user_id = '[user_id]'
and #__eb_registrants.checked_in = 1
and #__eb_events.alias = 'LHPS'
order by #__eb_events.event_date desc
limit 1]
where user_id = '[user_id]'
But it does not update the relevant record in the DB.
I read this post:
www.joomlapolis.com/forum/153-professional-member-support/228217-custom-auto-action-on-after-user-save
Please help, it's driving me mad!
Cheers.