Php mysql loading not working successfully

I am getting the following errors:

  • Warning: mysql_connect () [function.mysql-connect]: Access DENIED for user 'a5467268_andrew'@'10.1.1.19' (using password: YES) in / home / a 5467268 / public_html / andrew / fileupload.php on line 2
  • Warning: mysql_select_db (): The argument provided is not a MySQL-Link VALID resource in / home / a 5467268 / 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>

      

+3


source to share


1 answer


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

This happens when you use a password for a db user that doesn't exist.



Try the following:

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

      

0


source







All Articles