how to delete photos in folder php mysql datbase

Diposting oleh Algam on Senin, 29 Juli 2013

Ass .. for this article I will tell baimana delete photos in php and MYSQL database with photos that were deleted in the folder .. This allows the script folder size is not too big and not over load actually does not apply to the images alone but applies to anything like PDF or ZIP. Not much stale stale I will reveal the secret

example Script

if ($ mode == "delete") {

                 $ new = mysql_query ("SELECT * FROM` table `WHERE id_primary name = '$ id'");/ / table to determine which would be in the clear

    $ folder = mysql_fetch_array ($ new);

    $ where = $ folder ['nama_field_foto'];

     $ imagedelet = "try / images / $ spot";/ / address of where the photo

      unlink ($ imagedelet);/ / script delete folders

      $ sqlquery = "DELETE FROM` nama_table `WHERE` id_primary `= '$ id'";

      $ querycek = mysql_query ($ sqlquery);/ / sql script delet

                             

echo "<script> alert ('Delete successfully'); </ script>";/ / message

echo "<script> document.location.href = 'address in the heading after successfully remove'; </ script>";

}

?>

Sumber MYBLOG Inspiration OF Dreams

{ 0 komentar... read them below or add one }

Posting Komentar