Jump to content

Recommended Posts

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.

Link to comment
https://forums.phpfreaks.com/topic/155534-solved-what-is-this-error-telling-me/
Share on other sites

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.

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)

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."'");

 

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.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.