I would say, first check with your database connectivity, then check, whether it is connected with right database or not ? Check for how many rows is being selected.
I will recommend you to use show_error() function to validate your database connection.