last pix upload doubles when I refresh
it seems that the variable $filename is always there and is always the same name of the last uploaded picture. so when you refresh
the page this variable name gets inserted into the sql, again and again and again when you keep refreshing it.
but when you upload a new picture, this variable will have a new name, and then when you refresh this name will be inserted into the database again and again, therefore repeating the pictures (doubling it).
so in essence when you refresh you are running the code to insert the variable name to the sql. we need to change this from happening, if you have any suggestion let me know.