External query
-
Dear President MCCheese,
I would like to use the ummquery shortcode to query another table on the db using the current user key.
I explain more in detail:
1) I have a user with id 27
2) When logged in if the user go to the page where there is the shortcode [usermeta key=”contract_type”], he can see his contract type.
3) I have another table in the DB with the following fields:
– user_id
– ticket_id
– support_hours_spent_on_ticket
I would like to be able to execute a SQL statement like this:
“SELECT sum( support_hours_spent_on_ticket
) FROMsupport_tickets
WHERE user_id =27″I know I can use thid shortode, but I would like to ask if there’s a way to query external tables using the current user_id as reference:
[ummquery before_result=”” after_result=”” before_item=”” after_item=”” item=”%v” key_format=”ucwords” value_format=”ucfirst” list=”meta_value” where=”usermeta.meta_key=’Company'”]
Thank you very much in advance for your help!
- The topic ‘External query’ is closed to new replies.