gpt4 book ai didi

php mysql视频上传无法成功运行

转载 作者:可可西里 更新时间:2023-11-01 09:05:53 25 4
gpt4 key购买 nike

我收到以下错误:

  1. Warning: mysql_connect() [function.mysql-connect]: Access DENIED for user 'a5467268_andrew'@'10.1.1.19' (using password: YES) in /home/a5467268/public_html/andrew/fileupload.php on line 2
  2. Warning: mysql_select_db(): supplied argument is not a VALID MySQL-Link resource in /home/a5467268/public_html/andrew/fileupload.php on line 3
<?php
$con=mysql_connect("","","");
mysql_select_db("login",$con);
extract($_POST);

$target_dir = "test_upload/";
$target_file = $target_dir . basename($_FILES["fileToUpload"]["name"]);

if($upd)
{
//$imageFileType = pathinfo($target_file,PATHINFO_EXTENSION);
$imageFileType= $_FILES["fileToUpload"]["type"];

if($imageFileType != "video/mp4" && $imageFileType != "video/avi" && $imageFileType != "video/mov" && $imageFileType != "video/3gp" && $imageFileType != "video/mpeg")
{
echo "File Format Not Supported";
}
else
{
$video_path=$_FILES['fileToUpload']['name'];
mysql_query("insert into video(video_name) values('$video_path')");
move_uploaded_file($_FILES["fileToUpload"]["tmp_name"],"test_upload/".$_FILES["fileToUpload"]["name"]);
echo "uploaded ";
}
}
?>
<form method="post" enctype="multipart/form-data">
Choose Video<input type="file" name="fileToUpload"/>
<input type="submit" value="uplaod" name="upd"/>
</form>

最佳答案

Warning: mysql_connect() [function.mysql-connect]: Access DENIED for user 'a5467268_andrew'@'10.1.1.19' (using password: YES) in /home/a5467268/public_html/andrew/fileupload.php on line 2

当您为不存在的数据库用户使用密码时,会发生这种情况。

试试这个:

mysql_connect('server_name','db_user','db_user_password');

关于php mysql视频上传无法成功运行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31177312/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com