i use this statement when i want to copy data in selected fields in a table.
INSERT INTO student_subject (subjectid, noofsem)
SELECT subjectid, noofsem FROM study_plan
WHERE student_subject.intakeid = study_plan.intakeid
INSERT INTO student_subject (subjectid, noofsem)
SELECT subjectid, noofsem FROM study_plan
WHERE student_subject.intakeid = study_plan.intakeid
UPDATE subject_section
SET facultyid =
(SELECT facultyid FROM ref_subject
WHERE subjectid = subject_section.subjectid)
SELECT dob,
COUNT(dob) AS NumOccurrences
FROM users
GROUP BY dob
HAVING ( COUNT(dob) > 0 );
in_array($value_to_check, $array_to_check);
array_key_exists($key_to_check, $array_to_check);