我在while循环中有问题..我的问题在下面描述。
$sql = mysql_query($query, $this->db);
if(mysql_num_rows($sql) > 0)
{
$result = array();
while($rlt = mysql_fetch_array($sql,MYSQL_ASSOC))
{
$theature = explode(",",$rlt['mw_movie_theature']);
//echo 'count'.count($theature).'<br/>'; print_r($theature);
for($i = 0; $i<count($theature); $i++ )
{
$sqls = mysql_query("SELECT * FROM mw_theatres WHERE status = 1 AND id='".$theature[$i]."'", $this->db);
$rlts = array();
while($rlts = mysql_fetch_array($sqls,MYSQL_ASSOC))
{
$rlt['movie'] = $rlts;
}
}
$rlt['value'] = 'true';
$result[] = $rlt;
}
echo '<pre>';print_r($result);die;
$theature 变量有 2,3,4 个值。但 $rlt['movie'] 的值仅给出最后 4 个 id 结果。我想要 2,3,4 个 id 值。