Ajax / Php:使用下一个/上一个按钮从数据库进行视频预览

时间:2019-03-15 11:53:05

标签: php ajax phpmyadmin

希望您做的很棒!

我想从我的网站上的数据库中预览视频(一次1个),并使用上一个/下一个按钮浏览它们。我正在从这里使用此代码-https://makitweb.com/ajax-pagination-with-jquery-and-php/-从我的数据库中打印出数据,并且可以很好地处理文本详细信息(此后,我将在带有视频名称的标签处添加源以在播放器上获取),但是< strong>问题是,此脚本将整个数据打印在一行中,我需要将其分开。在那种情况下,我将能够将数据放在不同的div上。我对ajax / php很陌生,所以我有一个问题,有没有办法使它单独打印数据而不是将其打印为1个元素(在这种情况下行)?我将提供一个屏幕截图来阐明: Image

实时演示(网站): 141.136.44.131

141.136.44.131/upload.php 表单,可将​​视频上传到db和“ content”文件夹。

HTML文件(我现在具有用于打印详细信息的表格):Index.php

setupViews

HTML文件(将在其中放置详细信息的表单):index.php

def getItemFromList[T](inp: Mono[List[T]]): Mono[T] = {
    val moList = inp.defaultIfEmpty(List[T]())
    moList.flatMap[T]((list: List[T]) => {
      if (list.isEmpty) Mono.empty[T]()
      else Mono.just(list.head)
    })
  }

PHP文件:getEmployeeInfo.php

<div id="content">
<table width="100%" id="emp_table" border="0">
    <tr class="tr_header">
        <th>Employee id</th>
        <th>Employee Name</th>
        <th>Salary</th>
    </tr>
</table>

<div id="div_pagination">
<input type="hidden" id="txt_rowid" value="0">
<input type="hidden" id="txt_allcount" value="0">
<input type="button" class="button" value="Previous" id="but_prev" />

<input type="button" class="button" value="Next" id="but_next" />
</div>

Ajax脚本文件:

  <!-- PROJECTS -->
  <div class="container-fluid">
    <div class="row">
      <div class="col-md-12 padding-R"></div>
    </div>
    <div class="row">
      <div class="col-md-2 side-projects"></div>
      <div class="col-md-10 bg-projects"></div>
    </div>
    <div class="row">
      <div class="col-md-2 side-projects">
        <h1 class="side-projects-text"><b>PROJECTS</b></h1>
      </div>
      <div class="col-md-4 bg-projects">
        <div class="outline">

         <input type="hidden" id="txt_rowid" value="0">
           <input type="hidden" id="txt_allcount" value="0">
          <video id="videoPlayer" class="video" poster="content/projects-1.jpg" preload="none">
            // SOURCE FOR VIDEO FROM DB BY VIDEOS NAME
            <source src="content/The Pretty Reckless - Cold Blooded.mp4" type="video/mp4">
            <source src="content/The Pretty Reckless - Cold Blooded.mp4" type="video/ogg">
          </video>
          <h3 class="service-names"><a href="javascript:delay('music-video-clip.php')"><b class="text-button">MUSIC
                VIDEO CLIP</b></a></h3>
        </div>
      </div>
      <div class="col-md-4 text-padding bg-projects">
        // PROJECT NAME FROM DB
        <h2><b>The Pretty Reckless - Cold Blooded</b></h2>
        // PROJECT DESCRIPTION FROM DB
        <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut pretium, est sed porta aliquam,
          ipsum augue imperdiet lorem, ut dignissim arcu dolor in purus. Donec non metus eget ipsum sollicitudin
          porttitor ut pellentesque enim. Donec pretium varius felis non sodales. Orci varius natoque penatibus et
          magnis dis
          parturient montes, pretium varius felis non sodales. Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
        <div class="col-md-12">
          <div class="row text-button-padding">
            <input type="button" class="text-button" value="Previous" id="but_prev" />
            <input type="button" class="text-button" value="Next" id="but_next" />
            <input type="hidden" id="txt_rowid" value="0">
            <input type="hidden" id="txt_allcount" value="0">
          </div>
        </div>
      </div>
      <div class="col-md-2 bg-projects"></div>
    </div>
    <div class="row">
      <div class="col-md-2 side-projects"></div>
      <div class="col-md-10 bg-projects"></div>
    </div>
  </div>

抱歉,这个查询时间过长!希望您能帮我解决这个问题! :)

0 个答案:

没有答案