don't use books, imho the best way to learn is to do it by viewing examples. If you want, I have a couple of examples that are lying around like hit counters and such, really simple, but well commented so that you can learn from it. Plus the fact that you can look up queries at php.net also help.
edit: 500th post