Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Regular Coder
    Join Date
    Jun 2002
    Posts
    349
    Thanks
    2
    Thanked 0 Times in 0 Posts

    special characters corrupting database. is this possible? from a file upload utility?

    Hello,

    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.

  • #2
    Super Moderator
    Join Date
    May 2002
    Location
    Perth Australia
    Posts
    4,108
    Thanks
    11
    Thanked 101 Times in 99 Posts
    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

    e.g.

    "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
    resistance is...

    MVC is the current buzz in web application architectures. It comes from event-driven desktop application design and doesn't fit into web application design very well. But luckily nobody really knows what MVC means, so we can call our presentation layer separation mechanism MVC and move on. (Rasmus Lerdorf)


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •