php mysql video upload not successfully functioning -
i getting following errors:
- warning: mysql_connect() [function.mysql-connect]: access denied user 'a5467268_andrew'@'10.1.1.19' (using password: yes) in /home/a5467268/public_html/andrew/fileupload.php on line 2
- warning: mysql_select_db(): supplied argument not 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 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 user 'a5467268_andrew'@'10.1.1.19' (using password: yes) in /home/a5467268/public_html/andrew/fileupload.php on line 2
this occurs when you're using password db user doesn't exist.
try this:
mysql_connect('server_name','db_user','db_user_password');
Comments
Post a Comment