People ask me which book to buy for SQL. My recommendation is SQL: The Complete Reference by James R. Groff, Paul N. Weinburg, and Andrew J. Oppel, now in the third edition.
When you are writing commercial code, you need to know how to write database transactions and you need to know the variations in SQL for several databases. SQL: The Complete Reference covers those extra details.
Read more about SQL in SQL.
Start with PHP, the Apache Web server, and the MySQL database. As soon as you have your Web site running reliably with MySQL, buy SQL: The Complete Reference, set up the sample databases and practice with SQL Server then Oracle.