Debugging PHP Fatal Error
-
Hi,
I’m working out a few bugs following an update to php 8 and wp 6.0.3 for an older custom theme.
I’m getting the following error:
PHP Fatal error: Uncaught ArgumentCountError: mysqli_real_escape_string() expects exactly 2 arguments, 1 given in /var/web/site/public_html/wp-content/themes/x/customstyle.php:43 Stack trace: #0 /var/web/site/public_html/wp-content/themes/x/customstyle.php(43): mysqli_real_escape_string('3') #1 {main} thrown in /var/web/site/public_html/wp-content/themes/x/customstyle.php on line 43
Line 43 of customstyle.php:
$custompoststyles = get_post_meta(mysqli_real_escape_string($_GET['postid']), '_custom_css', true);
I tried removing “true” as I thought that represented a third argument but I get the same error message. Any thoughts or suggestions?
Viewing 8 replies - 1 through 8 (of 8 total)
Viewing 8 replies - 1 through 8 (of 8 total)
- The topic ‘Debugging PHP Fatal Error’ is closed to new replies.