-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
mysqli_real_escape_string not safe ? #7
Comments
Hi :) "But the mysqli safe ?" More info in this answer: http://stackoverflow.com/questions/5741187/sql-injection-that-gets-around-mysql-real-escape-string/12118602#12118602 so never set charset with a query like this one 'SET NAMES {charset}' |
There's also the issue of long term maintenance. If you use concatenated queries, even if correctly escaped, future developers are more likely to make mistakes. There's a discussion about it there: #3 |
yeah apart from maintenance . Technically there is no security flaws in between mysqli (not mysql) and prepared statements i think. |
i know mysql_real_escape_string is not safe
But the mysqli safe ? (improved version ).
Give me one example that will get around this ?
$id = mysqli_real_escape_string($con,htmlentities(trim($id)));
"SELECT * from table where id = '$id' "
The text was updated successfully, but these errors were encountered: