从foreach的TABLE中获取数据是否正确/可行

时间:2018-12-11 06:27:15

标签: php mysql

如果我做错了什么,请纠正我。我想从表中获取数据并将其用作数组:

$InRating = Db::getInstance()->executeS('SELECT * FROM `'._DB_PREFIX_.'seller_review`  WHERE `id_seller` = '.$value['id_seller']);

但是“ $ value ['id_seller'] ”的结果来自于此:

foreach ($SellerIn as $key => $value) {
  $value['id_seller']    
}

$ SellerIn -是对另一个表的数据库查询

这样做是正确的吗?

foreach ($SellerIn as $key => $value) {
   $value['id_seller']
   $InRating = Db::getInstance()->executeS('SELECT * FROM `'._DB_PREFIX_.'seller_review`  WHERE `id_seller` = '.$value['id_seller']);    
}

0 个答案:

没有答案