What I'm trying to do is produce a query that will use custom fields. I have the following tables:
entries
id
title
slug
user_id
section_id
entries_values
id
entry_id
sections_fields_id
value
sections_fields
id
name
value
section_id
So what I want to do is run a select beginning with entries and from there I want to be able to output the custom fields using something similar to entry.body where entry.body will be a custom field. I'm not sure if I'm being clear or not, but I'm not sure how to explain it so here's an example:
entries
id = 1
title = Test
slug = test
sections_fields
id = 1
name = body
entries_values
entry_id = 1
sections_fields_id = 1
value = This should be outputted by using entry.body
I'd like to perform this using one query instead of running multiple queries. Anyone have any guidance?