daniel kanyi daniel kanyi - 3 months ago 8x
PHP Question

how to display images and videos in a site from a database in php and mysql

I would like to display videos from my database called K-Movies in a table called videos.
But I don't know how.
Can someone help. THANKS!


ok here you go assuming you have your image src stored in a your database

$con = mysqli_connect("localhost","root","","K-Movies");
// Check connection
if (mysqli_connect_errno())
  echo "Failed to connect to MySQL: " . mysqli_connect_error();
if ($result = mysqli_query($con, "select * from videos")) {
while ($fetch = mysqli_fetch_assoc($result)){
echo "<img src='". $fetch['image'] ."' />";
} else {
echo "Query failed";