Php视频上传错误

时间:2014-05-06 10:38:11

标签: php mysql video file-upload

我正在尝试上传视频并将链接保存到数据库。我写了代码但是我收到了这个错误。有人知道我做错了吗?

$name = $_FILES['file']['name'];
$temp = $_FILES['file']['tmp_name'];

move_uploaded_file($temp,"uploaded/".$name);
$file = "http://127.0.0.1/webapp/video%20upload%20and%20playback/uploaded/$name";

mysql_query("
    INSERT INTO oefeningen (`Id`, `Fname`, `Lname`, `namevideo`, `video`, `expl`)
    VALUES (NULL, '$fname', '$lname', ,'$namevideo', '$file','$expl')
") or die (mysql_error());

THX!

我得到的错误是:

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''test.mov', 'http://127.0.0.1/webapp/video%20upload%20and%20playback/uploade' at line 2  

1 个答案:

答案 0 :(得分:0)

$lname', ,'$namevideo',

你有一个额外的逗号,所以它应该是

$lname', '$namevideo',