Jump to content

How to retriev videos from Database?


sangi

Recommended Posts

Thank you  for your reply and i have provided the code, which i have used to upload and retrieve the video files and i didn't get any error but the video didn't get played.

<?php

$conn=mysql_connect("localhost","root","");

mysql_select_db("sangi");

echo $_SERVER['REQUEST_METHOD'];

$r=$_GET['r'];

if($r==1)

{

$target="sangi/";

$target=$target.basename($_FILES['upfile']['name']);

$filename=basename($_FILES['upfile']['name']);

if(move_uploaded_file($_FILES['upfile']['tmp_name'],$target))

{

echo "file uploaded sucessfully";

mysql_query("INSERT INTO `sangi`.`det` (`sno` ,`filename`)VALUES ('', '$filename')");

$rst=mysql_query("select * from det");

while($qry=mysql_fetch_array($rst))

{

?>

<a href="sangi/<?php echo $qry['filename']; ?>" > download </a>

<?php

echo "<br>";

}

mysql_close($conn);

}

}

?>

<form action="upload.php?r=1" method="post" enctype="multipart/form-data">

<input name="upfile" type="file">

<input type="submit" name="Submit" value="Submit">

</form>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.