Код: Выделить всё
SELECT a.s_id AS sid,a.s_prog_id AS progid,a.s_acssn_id AS ssnid,a.s_name AS sname,a.s_admission_no AS sadmsnno,a.s_photo_name AS sphotonm,
b.sa_atten_code AS acode
FROM student_mst a
LEFT JOIN stu_attendance b
ON a.s_id = b.sa_s_id AND b.sa_atten_dt = ?
Код: Выделить всё
$this->db->select($this->select_column);
$this->db->from('student_mst a');
$this->db->join('stu_attendance b', 'a.s_id = b.sa_stu_id', 'left');
В приведенном выше запросе b.sa_atten_dt = ? предполагается, что он получит дату типа «2021-08-21» из переменной post.
Подробнее здесь: https://stackoverflow.com/questions/688 ... y-helper-m
Мобильная версия