Tjek SELECT
Syntaks
og JOIN
Syntaks
.
Men det enkleste svar -- tilføj endnu en JOIN..ON
erklæring.
select
ss.*,
se.name as engine,
ss.last_run_at + interval ss.refresh_frequency day as next_run_at,
se.logo_name,
pr.project_name -- +
from
searches ss
join search_engines se on ss.engine_id = se.id
join projects pr on ss.project_id = pr.id -- +
where
ss.user_id='.$user_id.'
group by ss.id
order by ss.project_id, ss.domain, ss.keywords
[REDIGER ] Jeg tilføjede -- +
kommentarer for at påpege mine tilføjelser.