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

Member Avatar for diafol

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

Member Avatar for cuonic

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.

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

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();});
}
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.