How to retriew video files from database????

Discussion in 'PHP' started by Sangeetha.M, Oct 6, 2008.

  1. #1
    Hi all,

    I have uploaded one video file and i stored its path name in database. When i tried to retriew it from the database, it din't get played...I don't know where it went wrong so please anyone of you help me.....:)
     
    Sangeetha.M, Oct 6, 2008 IP
  2. bartolay13

    bartolay13 Active Member

    Messages:
    735
    Likes Received:
    14
    Best Answers:
    1
    Trophy Points:
    98
    #2
    please post your code..
     
    bartolay13, Oct 6, 2008 IP
  3. Sangeetha.M

    Sangeetha.M Peon

    Messages:
    31
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Thank you for your reply,
    and i have provided the code below,
    <?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>
     
    Sangeetha.M, Oct 6, 2008 IP