搜索

首页  >  问答  >  正文

请大家帮我看一下底下这段代码,为什么分页失败了?在线急

最近写一个用户背单词的代码,为每个用户分配单词列表,在分页时出了点问题,主要是$datas[]这段代码有问题,还请指点一二

if(isset($_SESSION["username"]))
   $name=$_SESSION["username"];

$results=mysql_query("select * from study_progress where nickname='$name' and status='0' limit {$start},{$pageSize}");
   while ($rows= mysql_fetch_array($results)){
       $datas[]=array("enword"=>$rows['word']);
       $word=$rows['word'];
       $result = mysql_query("select * from words group by enword where enword='$word'");
       $row=mysql_fetch_array($result);
       $datas[]=array( "chword" => $row['chword'], "uk" => $row['uk'], "uk_m" => $row['uk_m'], "us" => $row['us'], "us_m" => $row['us_m'], "p_content" => $row['p_content'], "p_meaning" => $row['p_meaning'], "content" => $row['content'], "meaning" => $row['meaning'], "count" => $count);
   }

echo json_encode($datas);



FernwehFernweh1746 天前825

全部回复(1)我来回复

  • Fernweh

    Fernweh2020-02-15 10:24:54

    要不然就是json传递了两个数组参数,success该怎样接收并使用这两个数组数据?

    回复
    0
  • 取消回复