Right but I need to know what version of the software he is using. I work with the current version when looking at the code.
I have email errors turned on. I posted a ad in 2.3 and the image is renamed by the fixfilename function and I get no errors emailed.
Furthermore the query your posting will fail as noted by me because the $cat variable is empty. Hense more information is needed on what version of the software is being used.
In the code you posted you do not want to add slashes before the query as if you insert the image with a addslash you will break the display of the image as I noted. Since we will be looking for say
Yet the fixfilenames will rename the image like so and it will not be found.
Hense any correction in code must be placed in the proper place for things to work. Thus I stated I would get back to him after I did some testing.
So far as noted I can not get an error in 2.3 on this issue.