I am using PHP version 5.3 and trying to use mysql_real_escape_string($unescaped_string)
in my code, but I get the error:
Fatal error: Call to u
Interestingly, after exploring all the other solutions here, I realized the problem is actually due to the php5-mysql
extension not having been installed yet - it's not installed by default on a fresh Ubuntu, neither when u install fresh php. So, for me the solution became: install the php5-mysql extension:
sudo apt-get install php5-mysql
After this, I wasn't getting those nasty mysql_* errors again ;-)