Rcode_OK, 'data'=>"", 'msg'=>'ok' ); if(!isset($_GET['key'])){ $resObj['rcode'] = Rcode_NotParam; $resObj['data'] = ""; $resObj['msg'] = "key is must set"; echo json_encode($resObj); exit; } $conn = createConn(); $sql = "SELECT news.id,news.remark,news.title as name,news.image,news.source_val as source,news.sourceType FROM mysql85931094_db.hfy_news as news ,mysql85931094_db.hfy_news_type as n_type WHERE news.type_id = n_type.type_id and n_type.parent_type = ? and n_type.type_key = ? limit ?,?"; // 创建stmt $stmt = mysqli_prepare($conn, $sql); // 绑定 mysqli_stmt_bind_param($stmt, "dsdd",$parentSolutionType,$key, $offset,$limit); mysqli_stmt_execute($stmt); $res = mysqli_stmt_get_result($stmt); while($row = mysqli_fetch_assoc($res)) { $rs[] = $row; } mysqli_close($conn); $resObj['data'] = $rs ; echo json_encode($resObj); ?>