On Monday, November 2, 2015, I posted the second update of the second edition of “The Yii Book”. (I was hoping to blog about it here on Tuesday but…) This update brings the book to 307 pages, with four more revised chapters, bringing the total to 12. Specific release notes are…Continue Reading...
Archives For yiibook
Hey, ho! Just a quick check-in to let you know where things stand on the second edition of “The Yii Book”, for version 2 of the Yii framework. Over the past month I’ve started sequentially going through the book to update it for the new Yii version. I’ve also set targets in my mind, with my own target deadline (not sharing, because then it’s just embarrassing when the deadline sails past).Continue Reading...
Whenever you begin working with a database, you introduce more possible causes of errors. Thus, you must learn additional debugging strategies. When using PHP to run queries on the database, the problems you might encounter include:
An inability to connect to the database
A database error thrown because of a query
The query not returning the results or having the effect that you expect
None of the above, and yet, the output is still incorrect
On a non-framework site, you just need to watch for database errors to catch the first two types of problems. There’s a simple and standard approach for debugging the last two types:
Use PHP to print out the query being run.
Run the same query using another interface to confirm the results.
Debug the query until you get the results you want.
When using a framework, these same debugging techniques are a little less obvious, in part because you may not be directly touching the underlying SQL commands. Thankfully, Yii will still be quite helpful, if you know what switches to flip.