I’m having trouble creating a join in the codeigniter format, i have a MySQL query that returns what i want:
SELECT nwsite.siteid, nwsite.installer_username,
calcdata.esolar, calcdata.time, calcdata.wsolar
FROM nwsite, calcdata
WHERE nwsite.siteid = calcdata.siteid AND time = '2011-10-29 12:45:00';
I’ve looked at the documentation but i keep getting it wrong.
Thanks
From the CI docs…
So in your case, I would not use the cartisian product in your
FROM, I would actually use a join.For Future reference, I often utilize
to output the actual query that’s being generated. It makes it easier to debug and compare to what you are attempting to generate.