0

Hi guys,

I have created a site where users can upload videos(mp4) and images(jpg & gif).
The upload script sends the uploaded file to a folder on a remote server, and the filepath is stored in MYSQL.

Can any one tell how i go about playing the stored videos or show the stored images?

Also does anyone know how i can create thumbnails for uploaded videos?

any help or advice will be much appreciated...


Thanks,

2
Contributors
1
Reply
5
Views
7 Years
Discussion Span
Last Post by Atli
0

Hey.

To show the images, the general idea is:

<?php
$dbLink = new mysqli('localhost', 'usr', 'pwd', 'dbName');
if(mysqli_connect_errno()) {
    die('Failed to connect to MySQL: ' . mysqli_connect_error());
}

$sql = "SELECT `image_path`, `image_name` FROM `images`";
$result = $dbLink->query($sql);

if($result)
{
    while($row = $result->fetch_assoc())
    {
        echo "<img src='{$row['image_path']}' alt='{$row['image_name']}' /><br>";
    }
}
else
{
    echo "MySQL query failed: " . $dbLink->error;
}
?>

Same goes for the videos, except you would use whatever video playback mechanism you use instead of the <img> tag.

As for the thumbnails, I'm afraid I can't say. Haven't worked much with videos so far.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.