« February 7, 2008 | Main | February 29, 2008 »

February 19, 2008

Stupid PHP function name of the day

mysql_escape_string

Escapes a string for use in a mysql_query

This function became deprecated, do not use this function. Instead, use mysql_real_escape_string().

Alright then:

mysql_real_escape_string

Escapes special characters in a string for use in a SQL statement

And what makes it more ‘real’ that the previous one? The fact that it’s not deprecated yet? Then why not call it mysql_not_deprecated_escape_string? Or mysql_not_deprecated_as_of_php_4_3_0_escape_string?

Do not meddle in the affairs of Coding Ninjas, for they are subtle and quick to anger.