Closed NikolaKo closed 6 years ago
Thanks @NikolaKo, good catch. I guess this isn't very well tested, since I didn't have a database error to check it against! I will make a note to update the code at some point soon.
How are you getting on with the tutorial generally? :smile_cat:
Hi, generally I like the tutorial so far and I appreciate the fact it has some conceptual differences compared to usual materials (usage of diffs, gradual improvements, real life bugs etc.) , although it's fair to say I've been programming using other languages for some time so I'm mostly here to dive into syntax and some language specific patterns so I can't speak from the beginners point of view.
Thanks again.
No worries @NikolaKo. One area of improvement (which would be more suitable for you than for complete PHP beginners) is to use a proper framework. If you want something lightweight that is easy to learn, have a look at Slim Framework.
This is fixed in the latest release, thanks again for the report.
Hi,
I think I've spotted a minor bug in chapter 5 (https://ilovephp.jondh.me.uk/en/tutorial/make-your-own-blog/commenting-form?version=v5), when "addCommentToPost" function is first introduced this method "$pdo->errorInfo()" is used to get potential error if SQL query fails. I've noticed that my SQL queries were failing silently without any errors being caught so after a bit of investigation I found this: http://php.net/manual/en/pdo.errorinfo.php and according to that documentation :
I changed line 81 from "$errorInfo = $pdo->errorInfo();" to -> "$errorInfo = $stmt->errorInfo();" and that solved the problem for me.
Hopefully this helps.
Kind regards.