I’m trying to understand whether mysql_real_escape_string($str) can be empty if $str is not empty (by $str is empty I mean that empty($str) is true)?
I’m trying to understand whether mysql_real_escape_string($str) can be empty if $str is not empty
Share
So the return value is either
falseif there’s an error (like not being connected to the database), which counts as "empty". Or it’s the escaped string, which means that there are additional escape characters in the string.mysql_real_escape_stringwill not reduce the string.So if the string has content and you are connected to the database, if the input is not "empty", the output won’t be either. If there’s an error though, the output will be "empty".