Skip to content
Advertisement

Exception has occurred flutter

I have a method to read the data from the database. The code is completely working, but there is a problem, it is if I run the code and there is no data in the database, I get the error:

JavaScript

And my code:

JavaScript

PHP code:

JavaScript

I previously searched the old topics here and tried all the topics and problems similar to mine, but I did not find a solution to my problem.

How can I solve this problem?

Advertisement

Answer

You didn’t specify the header code if no data is found.

You should change your php code to this:

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