In my new project, I decided that I will use the RedBean ORM system with CodeIgniter PHP Framework.
How can I get all records from a table with a simple relation? I know that I can use R::exec or R::getAll queries, but I want to make sure if there any other solution(s).
TABLE STRUCTURE:
languages
- id
- title
categories
- id
- language_id
- title
The field language_id in the table categories is related with the id field in the table languages.
MY GOAL:
SELECT l.title, c.*
FROM categories AS c
LEFT JOIN languages AS l
ON (c.language_id = l.id)
Any solutions?
1 Answer