while($row = $stmt->fetch(PDO::FETCH_ASSOC))
.........
The variables are passing correctly and I have checked my database credentials and they are all correct but I am still getting the error
Fatal error: Call to a member function fetch() on a non-object
Any suggestions? Thanks in advance!