We're a community of 1077K IT Pros here for help, advice, solutions, professional growth and fun. Join us!
1,076,163 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Start New Discussion Reply to this Discussion

Image uploading - delete not work

I make an image administrator with PHP / MYSQL / AJAX. I try upload image - success! After uploading image I refresh page. uploaded image has added to list. I press delete button - image removes from list. But why it doesn`t remove from mysql list???

File can be downloaded here: http://www.avanti.lv/upload_image.zip

6
Contributors
4
Replies
5 Months
Discussion Span
1 Year Ago
Last Updated
5
Views
mcwebalizer
Newbie Poster
11 posts since Jul 2011
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0

Don't do download coade link. This is why nobody's bothered to answer you. Post your code.

diafol
Keep Smiling
Moderator
10,654 posts since Oct 2006
Reputation Points: 1,628
Solved Threads: 1,510
Skill Endorsements: 57

You delete the file from the MySQL Database, but you don't delete it on the local filesystem. Use unlink("files/$filename"); to delete it.

cuonic
Junior Poster in Training
67 posts since Mar 2011
Reputation Points: 18
Solved Threads: 11
Skill Endorsements: 0

maybe it was just deleted on your gallery(assumed) list table, but not in your main image(assumed) table, try creating another database query to delete it you're main table, and if your you want to delete the image file from your folder, thin use unlink

vaultdweller123
Posting Pro
574 posts since Sep 2009
Reputation Points: 47
Solved Threads: 81
Skill Endorsements: 2

in index.php you written URL in capital letter just change it into small cap..ur problem will solve.

Your code: URL:"delete.php",

Change :

$.ajax({
type: "POST",
url:"delete.php",


data: string,
cache: false,
success: function(){
upldimages.fadeOut('slow', function() {$(this).remove();});
}
swapy
Newbie Poster
1 post since Jan 2012
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0

This article has been dead for over three months: Start a new discussion instead

Post: Markdown Syntax: Formatting Help
 
You
View similar articles that have also been tagged:
 
© 2013 DaniWeb® LLC
Page rendered in 0.0653 seconds using 2.69MB