Answer the question
In order to leave comments, you need to log in
How to pass 2 dependent arrays to TWIG?
Hello, I've just started learning Twig template engine. The following question arose:
When accessing the database, I form an array $data_profit[]
$cat_profit=DB::run()->query("SELECT * FROM `user_cat_profit` WHERE `id_user`='".$_SESSION['id_user']."' AND `del`='0' ORDER BY `id_cat_profit` DESC");
while($data=$cat_profit->fetch())
{
$uncat_profit=DB::run()->querySingle("SELECT * FROM `user_uncat_profit` WHERE `id_user`='".$_SESSION['id_user']."' AND `del`='0' AND `id_cat_profit`='".$data['id_cat_profit']."'");
$data_profit[]=$data;
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question