Welcome Guest, Not a member yet? Register   Sign In
two foreach connect
#1

Hello everyone,
I have a question.
In my website I often have to link two different "foreach".
I usually do it like this

PHP Code:
foreach ($view_category_main as $main):
    
$SQL "SELECT * FROM db_todo_mission WHERE db_todo_mission.tb_todo_mission_main = ".$main['category_id']." GROUP BY db_todo_mission.tb_todo_mission_sub";
    
$query $this->db->query($SQL);
    foreach (
$query->result() as $sub):
        echo 
$sub->tb_todo_mission_sub;
    endforeach;
endforeach; 


Now i wonder if there is a more elegant way to store it in modal and then have it retrieved?
Reply


Messages In This Thread
two foreach connect - by Germanikus - 10-20-2020, 11:04 PM
RE: two foreach connect - by includebeer - 10-22-2020, 09:37 AM



Theme © iAndrew 2016 - Forum software by © MyBB