search

Home  >  Q&A  >  body text

Please help me look at the code below. Why does paging fail? Urgent online

Recently I wrote a code for users to memorize words, and assigned a word list to each user. There was something wrong during paging, mainly because there was a problem with the $datas[] code. Please give me some advice

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);



FernwehFernweh1734 days ago808

reply all(1)I'll reply

  • Fernweh

    Fernweh2020-02-15 10:24:54

    Otherwise, json passes two array parameters. How should success receive and use these two array data?

    reply
    0
  • Cancelreply