1

I have recently migrated from the old PHP5xx to PHP7.4.23 version and below is the error message when localhost URL is tested. I can confirm the index.php has reference to include rightbar.php from the same folder destination. If I remove the reference to rightbar.php then the website loads perfectly. I am not a coder but would need some great help on this. Website error:`PHP Fatal error:

Uncaught Error: Call to undefined function getResultBYkeyword() in C:\inetpub\wwwroot\tamilmelisai\rightbar.php:169 Stack trace: #0 C:\inetpub\wwwroot\tamilmelisai\index.php(28): include() #1 {main} thrown in C:\inetpub\wwwroot\tamilmelisai\rightbar.php on line 169`

Line 169 of rightbar.php has the following code:

<?php $videoDetailstops = getResultBYkeyword("latest tamil trailers",3); if(count($videoDetailstops)):?>
                  
zajonc
  • 1,935
  • 5
  • 20
  • 25
Neville
  • 11
  • 1
  • 3
  • 1
    Not sure if it's the problem, but check the casing of: `getResultBYkeyword`. The `Y` is uppercase. Should it be `getResultByKeyword`? – Iván Sep 07 '21 at 15:46
  • Thanks Ivan, still the same error. It must be something to do with the upgrade of PHP and it doesn't understand the command. – Neville Sep 08 '21 at 04:22

1 Answers1

0

After lots and trial and error, fianlly below is the solution that I worked it out even though I am not a coder by any chance. Appreciate all those who looked at the query and responded. Form this:

<?php $videoDetailstops = getResultBYkeyword("latest tamil trailers",3); if(count($videoDetailstops)):?>

To this:

<?php if (isset ($videoDetailstops) && $videoDetailstops = getResultBYkeyword("latest tamil trailers",3));?>
Neville
  • 11
  • 1
  • 3
  • `call to undefined function` means the line calling said function doesn't understand what the function is. That usually caused by function declaration (the `function getResultBYkeyword() {}` part is not included in current file. You solution doesn't make sense in that regard. Must be caused by some other modification you did while debugging. – ariefbayu Sep 13 '21 at 07:14