View Full Version : special characters corrupting database. is this possible? from a file upload utility?

05-18-2004, 01:16 AM

If I have an upload utility - without any checking for special characters, is it possible that someone could upload the name a file that would corrupt a databse??? like

my pic & of my dog.jpg

whatever, basically - my database is becoming corrupted and i've narrowed it down to this and I'm wondering if this could cause it.

please advise.

05-18-2004, 05:11 AM
basically no , if special characters are going to be an issue they will be an issue at INSERT time not later on , e.g. you record would never get created in the first place if the input was wrong.

what can happen is that you may have field names that are MySQL commands/reserved words , if you used phpmyadmin or similar to create the database then it would have allowed you to create the fields as it adds backticks to all the data .. and backticks are the solution if indeed that is the problem


"SELECT replace FROM my_table";

may or may not work depending on your MySQL version but

"SELECT `replace` FROM my_table"

probably will.
If your Database is really corrupt , e.g. unreadable then there are other issues occurring , almost certainly not relating to the data itself , also look at the REPAIR table syntax in the manual