I\'m thinking how to group my array by objects with the same value.
I have this result from MySQL query:
Date StartTime EndTim
EMPLOYER NAME DATA_PATH Alp 1. video_link 2. video_link Xyz 1. video_link 2. video_link 3. video_link
$stmt = $this->conn->prepare("SELECT a.employer_name,b.data_path FROM
rec_experience a INNER JOIN rec_multi_upload_data b
ON(a.rec_uniqueid=b.rec_id) WHERE b.data_type='Video' ORDER BY
a.c_date DESC ");
$stmt->execute();
$res = $stmt->fetchAll(PDO::FETCH_ASSOC);
$out = [];
foreach($res as $element)
{
$out[$element['employer_name']][] = ['video_link' =>
$element['data_path']];
}
echo json_encode($out);