Common mistakes to avoid in PHP
List of Stack Overflow questions about mistakes to avoid in PHP
A nice tutorial on PDO, the built-in SQL interface for PHP.
In particular, the official documentation doesn't say much about querying, but it's covered well here.
The other pages on the site are good too.
A static analyzer with (optionally very strict) type checking. Developed at Vimeo.
Includes a language server (link to docs)