
January 18th, 2013, 01:03 PM
|
 |
pollyanna
|
|
Join Date: Jul 2012
Location: Germany
|
|
Quote: | Originally Posted by mastrakis I would like to mention that security is not something i should worry for this project. |
Well, if you don't like the term "security", you might as well call it "correctness". Inserting raw values into query strings is technically wrong, because it breaks down as soon as the user inputs certain characters (as you just experienced).
Quote: | Originally Posted by mastrakis Could you tell me how i can modify it in order to take the title "abc'd" for example ? |
I gave you two links with the exact functions (the manual also includes examples).
A third possibility would be to escape every value by hand using pg_escape_string(), but that's ugly, tedious and error-prone. Only do that if you've already written thousands of lines and you cannot replace all your database code now -- or if you simply don't care about code quality.
|