2016 Oct 01 By Dusko 0 comment
This entry is part 1 of 2 in the series PHP Programming

I often use function safeEscapeString fromĀ  in my PHP projects. It helps sustain the integrity of data coming to and from MySQL or similar database. However, if the code ran on PHP 5.4 or 5.6 at the highest, and I wanted it to run PHP 7.0, the latest and greatest version of PHP. When the error reporting is turned on, a fatal error in code will appear. The solution is to use the recommended function mysqli_real_escape_string, which takes two parameters, the link and the string to sanitize. $temp2 = mysqli_real_escape_string($link, $temp2); Since I had not had a special link to…