页面显示无法按预期工作

时间:2015-07-08 21:22:28

标签: javascript jquery

我试图将记录显示为5的倍数,但我一次又一次只得到前5个记录。

首页 - slideshow.php

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

我在按下 LEARN SOMETHING ELSE 按钮时尝试增加$ count值。它重定向到next.php,我尝试将增加的值重新分配给count。

next.php

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

&GT;

echo语句给出5作为输出,但查询仍然只显示旧输出。如果我在我的查询中硬编码5,它会提供接下来的5条记录,但我无法在这里动态更改$ count的值。

请帮帮我

0 个答案:

没有答案