MySQL查询在另一个查询的同时循环php

时间:2016-12-08 00:34:36

标签: php mysql

我有以下代码:

$result = "SELECT * FROM season ORDER BY id";
$result = mysql_query($result, $con);
 while ($res = mysql_fetch_assoc($result))
{
   $j = $res["id"];
   $s_writer="SELECT writer_id,name FROM s_writer,writer 
              WHERE s_id=$j AND writer_id=writer.id ORDER BY priority;";
   while ($writer = mysql_fetch_assoc($s_writer))
   {               
          <span> <?php echo $writer["name"]; ?></span>
   }
}

但这会返回空值

0 个答案:

没有答案