最近写一个用户背单词的代码,为每个用户分配单词列表,在分页时出了点问题,主要是$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);
要不然就是json传递了两个数组参数,success该怎样接收并使用这两个数组数据?