You can use mysql_close(). The beginnign PHP book probably uses wrapper functions to abstract database-specific functionality. In this case, you probably have a function called "db_disconnect()" or "db_close()".
Just in case you're not familiar with the term, a wrapper function is a function who's purpose is to provide a generic interface to specific functionality. For example, if you write a website that uses MySQL, but then want to switch it to Postgres or SQL Server, you'll need to rewrite ALL of your SQL function calls (connect, query, etc) to use those databases instead of MySQL.
The ideal solution would be to "wrap" all of your mysql-specific functionality in wrappers. That way, your code ONLY deals with wrapper functions (e.g. db_connect(), db_query() ). When you want to switch databases, all you have to do is rewrite the body of your wrapper functions and the rest of your site continues to function normally -- it doesn't know or care WHAT database it's connecting to, as long as the database works.