This may happen due to any of the following problems:
Your database setting are not correct. Please check your database
settings again.
The database name is not correct. May be the database your code is
trying to get tables from is not same as the database you mentioned
in your database configuration.