duanlei7101 2015-11-02 06:06
浏览 33

如何在搜索表中的任何数据后获取所有数据表

i am working on one thing that i show the table and put a search filter on it. But in this system when i search date wise i get it correctly but then i have to go back and came to that page again for all data table. so how can i show my all table content after searching single data.

        <?php

        if (!isset($_SESSION['userid'])) {

                ?><div class="message">
                    To access this page, you must be logged.<br />
                    <a href="connexion.php">Log in</a>
                </div><?php
            }
            else{

                //Video count values of the database
                if(isset($_REQUEST['date1'])){
                    $req = mysqli_query($conn, 'SELECT video_master.id, user_master.username, user_master.rec_id, user_master.f_name, video_master.video_count, video_master.is_redim, video_master.video_date FROM video_master INNER JOIN user_master ON video_master.rec_id=user_master.rec_id where  user_master.rec_id="'.$_SESSION['userid'].'" AND video_master.video_date = "' . $_REQUEST['date1'] . '"');

                    // var_dump($req);
                }

                  else{

                        //We get the IDs, usernames and emails of users
                        $req = mysqli_query($conn, 'SELECT video_master.id, user_master.username, user_master.rec_id, user_master.f_name, video_master.video_count, video_master.is_redim, video_master.video_date FROM video_master INNER JOIN user_master ON video_master.rec_id=user_master.rec_id');

                }

    if(mysqli_num_rows($req)>0)
                {

                while($dnn = mysqli_fetch_array($req))
                {
            ?>
                    <tbody><tr>
                        <td class="left"><?php echo $dnn['id']; ?></td>
                        <td class="left"><?php echo $dnn['rec_id']; ?></td>
                        <!-- <td class="left"><?php //echo htmlentities($dnn['id'], ENT_QUOTES, 'UTF-8'); ?></td> -->
                        <td class="left"><?php echo htmlentities($dnn['username'], ENT_QUOTES, 'UTF-8'); ?></td>
                        <td class="left"><?php echo htmlentities($dnn['f_name'], ENT_QUOTES, 'UTF-8'); ?></td>
                        <td class="left"><?php echo htmlentities($dnn['video_count'], ENT_QUOTES, 'UTF-8'); ?></td>
                        <td class="left"><?php 

                         if($dnn['video_count'] < 250)
                                {
                                    $amount1 = $dnn['video_count']*0;
                                    echo $amount1;            
                                } 
                                    else
                                        {
                                            if($dnn['video_count'] <= 500)
                                            {
                                                $amount1 = $dnn['video_count']*0.25;
                                                echo $amount1;            
                                            } else
                                                {
                                                    if($dnn['video_count'] <= 750)
                                                    {
                                                        $amount1 = $dnn['video_count']*0.50;
                                                        echo $amount1;            
                                                    } else
                                                        {
                                                            if($dnn['video_count'] <= 1000)
                                                            {
                                                                $amount1 = $dnn['video_count']*0.75;
                                                                echo $amount1;            
                                                            } else
                                                                {
                                                                    if($dnn['video_count'] <= 1250)
                                                                    {
                                                                        $amount1 = $dnn['video_count']*1;
                                                                        echo $amount1;            
                                                                    } else
                                                                        {    
                                                                            if($dnn['video_count'] < 1500)
                                                                            {
                                                                                $amount1 = $dnn['video_count']*1.50;
                                                                                echo $amount1; 
                                                                            } else
                                                                                {

                                                                                }
                                                                        }
                                                                }
                                                        }                      
                                                } 
                                        } 
                                        ?></td>


                        <td class="left"><?php echo htmlentities($dnn['is_redim'], ENT_QUOTES, 'UTF-8'); ?></td>
                        <td class="left"><?php echo htmlentities($dnn['video_date'], ENT_QUOTES, 'UTF-8'); ?></td>


            <?php
                 }
             }
             }
            ?>

i created search from date wise.

  • 写回答

1条回答 默认 最新

  • douju7765 2015-11-07 06:39
    关注

    Make a button and reload the page on click. This is not the proper way but it solves your problem.

    评论

报告相同问题?

悬赏问题

  • ¥15 求帮我调试一下freefem代码
  • ¥15 matlab代码解决,怎么运行
  • ¥15 R语言Rstudio突然无法启动
  • ¥15 关于#matlab#的问题:提取2个图像的变量作为另外一个图像像元的移动量,计算新的位置创建新的图像并提取第二个图像的变量到新的图像
  • ¥15 改算法,照着压缩包里边,参考其他代码封装的格式 写到main函数里
  • ¥15 用windows做服务的同志有吗
  • ¥60 求一个简单的网页(标签-安全|关键词-上传)
  • ¥35 lstm时间序列共享单车预测,loss值优化,参数优化算法
  • ¥15 Python中的request,如何使用ssr节点,通过代理requests网页。本人在泰国,需要用大陆ip才能玩网页游戏,合法合规。
  • ¥100 为什么这个恒流源电路不能恒流?