Welcome Guest, Not a member yet? Register   Sign In
JOIN Quistion


i'm using a join to connect 3 tables.

My content table
A connecting table between the pictures and the content
And a picture table


I need the ID of the first table in my view for an edit function.
BUT CI only gives me the ID if the second table is filled in. This is because the ID is used as forign key in the second table.

This second table wil not always be filled in, because the second table is for the pictures and not every text has pictures.

Because it's not always filled in CI reads NULL as ID when the second table isn't filled in.


So i found in my MySQL guide a solution for the join.

FROM (`alinea`)
LEFT OUTER JOIN `image_koppel`
USING ( alinea_ID )
LEFT OUTER JOIN `image` ON `image_koppel`.`image_ID` = `image`.`image_ID`
WHERE `alinea`.`pagina_ID` = '1'
AND `alinea`.`alinea_status` =1
ORDER BY `alinea`.`alinea_volgorde` ASC";


instead of



does anybody know how i can write the statement above in CI style?
because i can't find it anywhere how i can produce JOIN '' USING in CI

(i hope i explained everything clearly)

Messages In This Thread
JOIN Quistion - by El Forum - 08-19-2009, 04:06 AM
JOIN Quistion - by El Forum - 08-19-2009, 08:44 AM

Theme © iAndrew 2016 - Forum software by © MyBB