Quantcast
Channel: Recent Topics - Joom Donation - Joomla Extensions by Joomdonation - Joomla Extensions by Joomdonation
Viewing all articles
Browse latest Browse all 23651

Get user id for SQL custom field - by: Connor Walsh

$
0
0
I'm using event booking for users to register their kids for summer camps. Each user has already entered their child's information on the website and this is stored in a database table. The children are linked to their parent via the current users id

My custom field is just going to be a select list with the children's names. I planned to do this with the SQL custom field type, with the query "SELECT child_name AS value, child_name AS text FROM #__child_master WHERE parent_id = $user_id"

I'm just not sure how to get the current user_id in that sql statement. If it were php I could just do JFactory::getUser()->id, but trying that in my statement didn't work.

Any ideas on how I can do this?

Thanks!

Viewing all articles
Browse latest Browse all 23651

Trending Articles