我有这样的php代码:
$q = $db->query("SELECT * FROM tabe1_data WHERE status='1' ORDER BY id DESC LIMIT 10");
$cr_onr = array();
while($row = $db->fetchAll($q))
{
$cr_onr[] = $row;
}
?>
<?php foreach($cr_onr as $new_cr_onr):?>
<?php $crinfo = $db->fetchOne("SELECT * FROM tabe2_data WHERE id ='".$new_cr_onr['op_id']."'");?>
<p><?=$new_cr_onr['username'];?> has been complete <?=$crinfo['op_amount'];?></p>
<?php endforeach;?>
我需要在$crinfo = $db->
“foreach”之前取出“foreach”
请问我该怎么做?
谢谢你。