I would like to get a multidimensional array from my sqlite tables, with join. I have two tables:
TABLES:
- projects ----------- - images ------------------
- id - - id -
- title - - filename -
- images (has many) - - project_id (belongs to) -
---------------------- ---------------------------
and I want the following array
PROJECT_ARRAY
{
id: 1
title: My Project
images: IMAGES_ARRAY
{
image1.jpg
image2.jpg
image3.jpg
}
}
how do I join my tables with sql query?
this does not work:
SELECT project.title, image.filename
FROM project JOIN image
ON image.project_id = project.id;