TRFM....
warning: my opinion follows: it is by no means the answer and may not be so for you:
don't trust book code... they most likely work but are far to uncomplex and incomplete to be usefull in the real world... and they are as expensive as your textbook and contain much less information...
what you need to worry about is what to do not how to do it.... how to do it is always af ew manual pages and a trip to the forum away... its what to do that is hardest to figure out...
the best way to learn what to do is to take out a usefull product (someone elses free code online) and just read through it... not for the specific code tricks... but for the general impression of how they are applying the concepts of what you learn in class into real life code... what do they use sessions for... what do they put in their libraries... what types of objects do they have
the best way to learn what php wants you to do with it is RTFM... it explains all the features and they common usages
if you want to know about PHP and MYSQL.... read all the docs on the mysql_ functions... it will show you exactly what php can do to mysql... the full capabilities of how php can posibly communicate to mysql... and if you read a book, most likely they will have a large portion devoted to repeating the php manual in slightly different terms.... and then will show basic vanilla examples of how to use them... which will be too simple for you to use