News for hackers. Stuff that matters.
Re:What are the books banned in camp Guantanamo? by projektfu on Sunday January 15, 2017 @08:11AM (#13403801)
For the 10,000 who might be learning about this today, the answer is prepared statements with placeholders for the values, like this pseudocode:

   stmt = driver.prepare("insert into names 
      (firstname, lastname) values (?, ?)");
   stmt.execute("Flannery", "O'Connor");
Syntax varies among database interfaces but this ensures that any odd strings are properly stored by the driver and the application does not need to worry about them. There is also no risk of someone rewriting the SQL statement.

There are no comments on this comment yet.