Invalid argument supplied for foreach()
You will get this error if foreach() is not an array. So your first step should be to debug this by inspecting the contents of $results to confirm that the results are what you expect. If it’s not then it might give you clues to why. This is debugging 101. If you do that you’ll … Read more