Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I know the PHP/PDO way to do it, is prepared statements.

I'm not able to see why the parent's suggestion to just escape the strings is not a valid solution from a security perspective.



because you also have integer based SQL injection. Escaping strings isn't a complete fix.


Yep. In fact the typical SQL injection example is " 0 OR 1=1 ".


>that's less secure than prepared statements, and may break some things (eg if the code is relying on certain things not being escaped, etc)




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: