foreach ($_SESSION['exampleOne'] as $item)
{//insert sql
foreach ($_SESSION['exampleTwo'] as $comment)
{//insert sql
如何将 2 个 foreach 合并在一起?现在我的数据库存储是这样的..:
comment | item
---------------
Nice! | Pants
Great! | Pants
Awesome!| Pants
Nice! | Skirts
Great! | Skirts
Awesome!| Skirts
Nice! | Shirts
Great! | Shirts
Awesome!| Shirts
当我存储它时,我希望它以某种方式在我的数据库中是这样的:
comment | item
---------------
Nice! | Pants
Great! | Skirts
Awesome!| Shirts