Hi i am a little bit stuck.
I have two atbels, i retrieved the data from them but i don’t know how to group the data.
The output i want:
Session 1
-ex name
-ex name
The output i get:
Session 1
-ex name
Session1
-ex name
I think i need to put the data in an associativ array but i don’t know how.
If you can, please help me!
Thank yoouuuu.
My code:
<?php
$query = "SELECT * FROM programs_sessions INNER JOIN exercises ON programs_sessions.session_id = exercises.session_fk WHERE prog_fk=". $prog_id;
$result = mysqli_query($conn, $query );
$sessions = array();
if (mysqli_num_rows($result) > 0 ) {
while ($row = mysqli_fetch_assoc($result)) {
$sessions[] = $row;
}
}