What I've been doing in this situation is using the code from the book that you can download. Then make a copy of their file, give it a slightly different name from yours and make the necessary changes to it for your installation (e.g. username and password, directory paths etc.). I think you will find that the copy works, so you then need to go through your code to find the difference(s). I've found this is the quickest way for me to figure it out. Good luck!