I think your function is cleared, so I suspect that you didn't input the database name when initialized the connection or maybe it's calling to another DB because the DB Name is inputted with another value.