Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: Beginning PHP5, Apache, and MySQL Web Development ISBN: 978-0-7645-7966-0
This is the forum to discuss the Wrox book Beginning PHP5, Apache, and MySQL Web Development by Elizabeth Naramore, Jason Gerner, Yann Le Scouarnec, Jeremy Stolz, Michael K. Glass; ISBN: 9780764579660
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning PHP5, Apache, and MySQL Web Development ISBN: 978-0-7645-7966-0 section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old March 19th, 2008, 06:33 AM
Registered User
 
Join Date: Mar 2008
Location: , , Portugal.
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default CHAPTER 7 - UPDATE an Image

hello!

I've been in chapter 7, and i've developed a form for the user to insert images.

WHen he inserts a image, it is uploaded. But if he wants later on to edit the current information and choose other photo?

I use the same code and use the "UPDATE" in sql?

Thanks in advance

Reply With Quote
  #2 (permalink)  
Old March 19th, 2008, 07:35 AM
Registered User
 
Join Date: Mar 2008
Location: , , Portugal.
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I found a way to upload...just created a new variable and then i dont use the lastpicid..

This is what comes when i try to "override" the image...

Warning: rename(c:/xampp/htdocs/uffizi/images/portfolio/09.jpg,c:/xampp/htdocs/uffizi/images/portfolio/emp51_antes.jpg) [function.rename]: File exists in C:\xampp\htdocs\uffizi\cms\commit.php on line 49

Any function that can override the file?

Reply With Quote
  #3 (permalink)  
Old March 19th, 2008, 12:06 PM
Registered User
 
Join Date: Mar 2008
Location: , , Portugal.
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I tried to use the function file_exists like this

                            if(!file_exists($newfilename)){
                            rename($ImageName, $newfilename);

}
----------
If the name of the newfilename doesnt have the same name he can upload the new image...but if dont, he doenst save the new image...

....

Reply With Quote
  #4 (permalink)  
Old March 19th, 2008, 01:13 PM
Registered User
 
Join Date: Mar 2008
Location: , , Portugal.
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default

and basically i still want to save the new image and i cant..

Help!

Reply With Quote
  #5 (permalink)  
Old March 20th, 2008, 12:27 PM
Registered User
 
Join Date: Mar 2008
Location: , , Portugal.
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Still not any answer...

What i want is give the oportunitie the user to change his file and stays with the same name!!

Any guidance...please?

Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Update IMAGE file in SQL Server KingMonty SQL Server 2005 2 October 5th, 2007 04:09 PM
Image -- Insert/Update/Delete in sql2000 !!! dagad ASP.NET 2.0 Professional 0 October 27th, 2006 08:25 AM
Image -- Insert/Update/Delete in sql2000 !!! dagad ASP.NET 2.0 Basics 0 October 27th, 2006 08:25 AM
How to update asp:image control busybee ASP.NET 1.0 and 1.1 Basics 2 March 23rd, 2006 03:03 AM
Dynamic Image Update aymawadi ADO.NET 1 April 10th, 2005 04:53 PM



All times are GMT -4. The time now is 04:17 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.