DEV Community

Discussion on: Illegal string offset

Collapse
 
steveby profile image
Stephen Berry

The code is exactly as shown on the instructions I am following, so I have no idea how they get the results shown. I will figure out how to do this. As the result will show the number of messages above the messages. So if there are three messages this will be a number.

Collapse
 
steveby profile image
Stephen Berry

Not long after posting the reply, I looked carefully at the code on the video and mine, and it turns out I had made a mistake. I had $rows = $row;, which should have been $rows[] = $row;. Once I corrected this, the results I got matched the video. In the words of a wise man "Doh!"