News for hackers. Stuff that matters.
Re:Moving the Linux Kernel to Modern C by masklinn on Thursday February 24, 2022 @04:05PM (#30460261)
> Same as the infamous PHP mysql_real_escape_string (don't make the mistake of using mysql_escape_string!) [2][3]

TBF that is really a straight bridge to the mysql C API, which is why it’s also in mysqli.

MySQL actually has a third one called mysql_real_escape_string_quote, because if the sql mode NO_BACKSLASH_ESCAPES is set the escaping function needs to know what context it’s used in, and thus what quote to double up, and mysql_real_escape_string will fail.

Re:Moving the Linux Kernel to Modern C by account42 on Friday February 25, 2022 @09:24AM (#30467589)
And of course, the real answer to wether you're supposed to use mysql_escape_string, mysql_real_escape_string or mysql_real_escape_string_quote is "why the fuck are you pasting queries together using string processing".