How can i display an image in my database (also using a search function that searches in my database)

Hi, i’m a student from Holland and i am using a html/php code so that when you click search it will search a specific video (later it will be any video you type in) but when i click search the video only gets displayed as a link that i converted from youtube = images/ but not the actual video itself like on my home page, i don’t get this to work because of the search function.

    <div class="search-box">
      <form action="Zoekpagina.php" method="post">
        <input class="search-text" type="text" name="search" placeholder="Zoek hier je video's">
        <input class="search-btn" type="submit" name="verzend" value="Zoek" href="Zoekpagina.php"   >

include "Connect.php";
$conn = mysqli_connect($server,$user,$pass,$db)
  or die("Fout: Er is geen verbinding met de MySQL-server tot stand gebracht!");
        $show="SELECT * FROM VideoPagina WHERE VideoNaam ='how to train'";
        $result= mysqli_query($conn,$show);
        while($rows = mysqli_fetch_assoc($result)){
          echo $rows['Bestand'];
          echo $rows['VideoNaam'];
          echo $rows['VideoBeschrijving'];
          echo "test";
        echo"nothing found"; 
  echo"Druk op de search button!";

Are you trying to display an image? Or a link? If you want to display a link you have to put the html part of the link in the display. If you are displaying an image, you need to put in the html part also. To put an image into a display, you can use something like this:
echo “<img src=’” . $rows[‘VideoBeschrijving’] . “’>”;
If you are putting a link in the display, you need to insert the HTML for “< href >” tag.

Not sure if that is what you are asking… In PHP you need to display the HTML for items along with the data. Hope that helps.

Sponsor our Newsletter | Privacy Policy | Terms of Service