derekbelcher Posted April 24, 2009 Share Posted April 24, 2009 I am trying to create a picture upload script and am getting an error: Warning: move_uploaded_file(uploads/popup.htm) [function.move-uploaded-file]: failed to open stream: Permission denied in /home/p2r71184/public_html/stationAdmin/athens/uploadPhoto.php on line 43 Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move '/tmp/phpoxIFzt' to 'uploads/popup.htm' in /home/p2r71184/public_html/stationAdmin/athens/uploadPhoto.php on line 43 There was an error uploading some of the file(s), please try again! Maybe the file size is too large. Maximum file size is 5MB. Thanks. Quote Link to comment https://forums.phpfreaks.com/topic/155534-solved-what-is-this-error-telling-me/ Share on other sites More sharing options...
mikesta707 Posted April 24, 2009 Share Posted April 24, 2009 You may not have the correct permissions set for scripts in those folders. Try changing your folders permissions (to 777 I believe) and try again Quote Link to comment https://forums.phpfreaks.com/topic/155534-solved-what-is-this-error-telling-me/#findComment-818469 Share on other sites More sharing options...
derekbelcher Posted April 24, 2009 Author Share Posted April 24, 2009 That was part of the problem. Oversight...thanks. One other small problem. I know I need to connect to my database, but I am unfamiliar with this line: mysql_query("update tbl_athensPhoto set photo = '".$_file_name."' WHERE whatever = '$whatever "); my tablename is: athensPhoto. What is the WHERE looking for? thanks. Quote Link to comment https://forums.phpfreaks.com/topic/155534-solved-what-is-this-error-telling-me/#findComment-818486 Share on other sites More sharing options...
jonsjava Posted April 24, 2009 Share Posted April 24, 2009 the WHERE will be the condition you know it to equal. Example. Joe wants to update his status to single. The table is `dating` "UPDATE `dating` SET `status`='single' WHERE `name`='Joe'; Quote Link to comment https://forums.phpfreaks.com/topic/155534-solved-what-is-this-error-telling-me/#findComment-818488 Share on other sites More sharing options...
Maq Posted April 24, 2009 Share Posted April 24, 2009 Whatever $whatever is... If you change your code a little bit you can see exactly what the query is: $sql = "UPDATE tbl_athensPhoto SET photo = '$_file_name' WHERE whatever = '$whatever'"; echo "QUERY: " . $sql; mysql_query($sql); You were also missing a single quote after $whatever in your query. (I also formatted a little bit) Quote Link to comment https://forums.phpfreaks.com/topic/155534-solved-what-is-this-error-telling-me/#findComment-818489 Share on other sites More sharing options...
mikesta707 Posted April 24, 2009 Share Posted April 24, 2009 Where is looking for some criteria to execute whatever mysql command you want to execute. the right side of the = sign is a column name, and the left side is a value. Where tells the Mysql where you want to make whatever changes you are making.Say you wanted to update your database where the column named id is equal to 5 you would write $id = 5; mysql_query("update tbl_athensPhoto set photo = '".$_file_name."' WHERE id = '$id "); If you wanted to set every entry in that table to have the column, photo set to $_file_name, you would do: mysql_query("update tbl_athensPhoto set photo = '".$_file_name."'"); Quote Link to comment https://forums.phpfreaks.com/topic/155534-solved-what-is-this-error-telling-me/#findComment-818492 Share on other sites More sharing options...
derekbelcher Posted April 24, 2009 Author Share Posted April 24, 2009 thanks. It is obvious i have much to learn, but hey what better place to do it. Thanks for your help. What I am trying to do is make a photo upload script for users to upload photos to the database. I am not a 100% sure how to get it to work. I thought I would create a table that had an id column and 15 fields for 15 photos, but I am not real sure what to do beyond this point. I'll keep playing. Quote Link to comment https://forums.phpfreaks.com/topic/155534-solved-what-is-this-error-telling-me/#findComment-818534 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.