The note I read suggests that you need to call bind_result() after you call store_result(), not in the order you have it. I haven’t used mysqli so I can’t say for sure.
I really don’t understand object based php code and I’ve rather not start learning it now 90% the way through my project
Also I figured out why my loop wasn’t working. I was looping through the results of $stmt, however created a new $stmt within the loop. School boy error I guess.
I don’t expect you to rewrite your project, but I would like to help you learn something new by the time you’ve finished the last 10%, and maybe you’ll consider it for the next project? I’m going to see if I have the time to write something up later to help people understand and to migrate from either MySQL or MySQLi to PDO. You’re welcome to read it or ignore it, but I think that if people are scared of it then the community has done a bad job of helping. I do understand the reluctance though; I was the same. Everyone is different though.
Back on topic, I’m glad that you worked out what’s wrong Presumably your example code would’ve worked OK then, and it’s the code that was removed for brevity that caused the issue. Maybe an IDE that points out that you’re reassigning a variable (which is usually a bad sign) would help in future?
I had a little go at writing an article about the basic differences between MySQL, MySQLi and PDO. I will write up actual migration tips when I get the chance, most likely next week now. Let me know if you think it helps though