How to display table even without result?

0

Good morning, I created this page to automate a process in the company: link

But it only displayed the nice tables only when there is data returned in the query, if there is no checked in google chrome console returns error "Uncaught TypeError: Can not read property 'length' of undefined" and I diagnosed that the problem is because it does not exist data returned in the query. The code is not very correct but it works only when there is data. How to test whether data exists or not, since I add the IF condition more by the way it does not work, it always returns TRUE.

    
asked by anonymous 24.08.2015 / 15:04

0 answers