Javascript 按页显示未按预期工作
我试图以5的倍数显示记录,但我一次又一次地只得到前5条记录 主页-slideshow.phpJavascript 按页显示未按预期工作,javascript,jquery,Javascript,Jquery,我试图以5的倍数显示记录,但我一次又一次地只得到前5条记录 主页-slideshow.php <select multiple class="form-control " id="sel2" size="10" > <?php session_start(); if (isset($_SESSION["min
<select multiple class="form-control " id="sel2" size="10" >
<?php
session_start();
if (isset($_SESSION["min"]) || isset($_SESSION["count"])) {
$time = (int)$_SESSION["min"];
$something = $_SESSION["something"];
$everything = $_SESSION["everything"];
}
$count = (int)$_SESSION["count"];
$select_query= "SELECT * from video_details WHERE c_something = '$something' OR c_everything = '$everything' HAVING video_min <= $time LIMIT $count,5";
$select_query_run = mysqli_query($conn,$select_query);
while ($select_query_array= mysqli_fetch_array($select_query_run) )
{
echo "<option value='".htmlspecialchars($select_query_array["video_question"])."' >".htmlspecialchars($select_query_array["video_question"])."</option>";
}
?>
</select>
<?php
$new = $count + 5;
$_SESSION["count"] = $new;
$_SESSION["min"] = $time;
$_SESSION["something"] = $something;
$_SESSION["everything"] = $everything;
//session_destroy();
?>
</div>
</div>
<div class="center">
<input type="button" class="btn btn-success font-30" value="I AM CURIOUS ABOUT THIS" />
<form id="next_page" name="next_page" method="post" action="next.php" data-ajax="false">
<input type="submit" class="btn btn-success font-30" id="next" name="next" value="LEARN SOMETHING ELSE" />
</form>
</div>
尝试将回显移动到您的主页文件。在头调用之前进行回显将中断重定向,因为它必须在打印输出之前发送头。实际上,我不需要那个回显语句。我把它给你检查一下。当我在那里打印时,值是5,但在我的主页中,会话变量计数没有变为5。它连续显示前五条记录,不移动到下一条5,并在下面显示答案。
<?php
session_start();
$inc = (int)$_SESSION["count"];
$time = (int)$_SESSION["min"];
$something = $_SESSION["something"];
$everything = $_SESSION["everything"];
echo $inc;
$_SESSION["count"] = $inc;
$_SESSION["min"] = $time;
$_SESSION["something"] = $something;
$_SESSION["everything"] = $everything;
header("location: HomePage-slideshow.php#services-section");