Skip to content
Advertisement

PHP Undefined offset: 0 error in server log. How to avoid it?

I am getting the title error in my Nginx server log. I have checked the many other similarly asked questions without success. The php script works as intended but the error keeps appearing everytime the page is hit.

Here’s the affected code:

JavaScript

And the relevant function (select_record) is as follows:

JavaScript

I’d greatly appreciate some help on this.

Advertisement

Answer

Check your result array before accessing..

JavaScript
User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement