Slashdot Mirror


Build Your Own Database-Driven Website

Chris Beasley writes "I have a PHP book that's 567 pages long. I have two SQL books: one has 377 pages; the other has 719. Yet I consider 295-page 'Build Your Own Database Driven Website using PHP & MySQL' by Kevin Yank more valuable than any of these books. Why? Because, while I may find only a quarter or, at best, half of these books useful on a regular basis, all 295 pages of Yank's new release are of value to me on a daily basis." Build Your Own Database-Driven Website Using PHP & MySQL, 2nd Ed author Kevin Yank pages 295 publisher SitePoint rating 5/5 reviewer Chris Beasley ISBN 0957921802 summary A tutorial-style book for beginning PHP/MySQL Programmers

Unlike the arbitrary structure exemplified by so many programmers' references, Build Your Own Database Driven Website using PHP & MySQL is written more like an instruction manual, with chapters arranged in the order in which you should use them.

The first chapter explains the installation of PHP and MySQL; the next two cover usage basics. In Chapter 4 you're already pulling information from your database and publishing it on the Web. Chapters 5-10 refine what you've already accomplished, and delve into advanced topics in both PHP and MySQL.

If you're familiar with Yank's original tutorial, on which he based this book, your familiarity will end with the closing pages of Chapter 10. Chapter 11 addresses the storage of binary data in MySQL, a topic that was of great interest to me personally as I'd never done it before. In keeping with the rest of the book, Chapter 11 is a step-by-step guide, and explains the storage of binary data in a practical, down-to-earth manner that inspires you to give the book's teachings a try. Already I'm searching for an excuse to build a system, just to experiment with what I've learned. Chapter 12 covers cookies and sessions in PHP. The usage of cookies and sessions is essential to any online authentication or shopping cart system, and this topic makes a great final chapter that complements the book's other lessons.

This book makes good on its promise to teach you everything you need to know to build a database driven Website, but fortunately for us the author decided to throw in a few extras -- these take the form of four reference appendices. Appendix A covers MySQL syntax, which, while covered throughout the book, is easily referenced through this well-organized appendix. Appendix B explains MySQL functions, while Appendix C covers MySQL datatypes in considerable detail, so much so that I found this information easier to use than the official MySQL online reference. Finally, Appendix D covers the PHP functions that are used with MySQL.

If you progress in your programming skills you'll eventually need to buy a complete programmer's reference for PHP, although you probably won't need to buy an SQL reference unless you start using a more robust database solution than MySQL. However, if you want to build your first database-driven website, or even if you have built one before but want a practical reference, I can't recommend this book highly enough. Build Your Own Database Driven Website Using PHP & MySQL will guide you step by step through the development process -- who could ask for more?

You can purchase Build Your Own Database-Driven Website Using PHP & MySQL, 2nd Ed from bn.com. Slashdot welcomes readers' book reviews -- to see your own review here, read the book review guidelines, then visit the submission page.

23 of 277 comments (clear)

  1. Re:Who wouldn't? by K. · · Score: 4, Informative

    Preprocessing pages and serving static html is one way of coping with high CPU loads incurred by having a popular dynamic site. So as in everything, the best path is the middle path. Or so my teacher Steven Seagal tells me.

    --
    -- Proud descendant of semi-nomadic cattle-herders.
  2. Database and web application security documents by Anonymous Coward · · Score: 1, Informative
  3. Re:PHP Too slow by odyrithm · · Score: 4, Informative

    php is way to slow for big sites :*( unfortunately with out some state of the art cache.

    obviously you dont know about this: http://apc.communityconnect.com/about.html

    --
    moo
  4. save your money by larry+bagina · · Score: 3, Informative
    I looked through this book at barnes & noble a couple weeks ago. I'd recommend skipping it, although it may be useful for some newbies.


    Basically, it's a tutorial (build a php/mysql website in 10 steps!). There are plenty of online resources (like devshed) that do tutorials like this all the time. (Note to slashdot editors: devshed spell checks submissions!). If you like to read on the john, this book might be for you. Chances are, you'd be better off to save your money for a mysql or php reference book.

    --
    Do you even lift?

    These aren't the 'roids you're looking for.

  5. Nice, timely review - the book is out of print by Anonymous Coward · · Score: 5, Informative
    I just looked at Barnes and Noble and found the book is no longer available!


    You know, it might be useful if Slashdot book reviews were limited to books that are currently in print!

    1. Re:Nice, timely review - the book is out of print by Derek+Pomery · · Score: 2, Informative
      --
      -- perl -e'print pack"H*","6e656d6f406d38792e6f7267"' /. ate my old sig. Bastards.
    2. Re:Nice, timely review - the book is out of print by mav[LAG] · · Score: 2, Informative

      You can get it from the source where they also make the first four chapters available as a free download. My copy should be arriving any day now...

      --
      --- Hot Shot City is particularly good.
  6. This book should be good because... by Anonymous Coward · · Score: 2, Informative

    it's based on a very popular article series he did for sitepoint.com and other sites. I dl'd and printed out all of those articles that comprise the base of the current book and they are dog-eared and well worn. I especially like his tone througout the articles (nice sense of humor) and concise coding style well explained. I will 'browse' this book at Bordersss if they have it and if I see new stuff I will buy it.

  7. Re:HOWTO-Build a DIY DB-driven site by KDan · · Score: 2, Informative

    Wrong. Install MySQL first and then install apache and mod_php together.

    Daniel

    --
    Carpe Diem
  8. Amazon bad, BN good... by teslatug · · Score: 3, Informative

    The book is apparently not available at BN, so I checked Amazon, and they have it.

  9. Download the First Four Chapters by TheAngryMob · · Score: 3, Informative

    Sitepoint (the publisher) has them here. The downside is you have to give them your email address first.

    --

    Don't just game, Dungeoneer
  10. This page is really useful for building a PHP DB by bladeohlsson · · Score: 1, Informative

    If you want to make a database for a FORUM or other online databases on Mac OS X, this is THE site to find everythign you need to do:

    http://www.entropy.ch/software/macosx/php/ The only thing he forgot is that having a little online webapp called webmin really helps setting up your MYSQL a TON, turst me, it is worth it if you are not an expert with this stuff, even I was able to do it.

    --
    http://www.ohlssonvox.com
  11. Re:Sounds good... by ceejayoz · · Score: 2, Informative

    perhaps it's the sucky perl-like syntax

    Perl-like? It's C-like, if anything, which makes it easy for someone who has experience in C or Java to pick up.

    or rather, I should say the plethora of built-in functions

    What's wrong with lots of built-in functions?

    so many PHP purists these days insist that you can't use PHP for templating any more (thus running contrary to the original purpose of the language) and that you have to print all your html with print statments inside a single tag.

    I've never come across a competent PHP developer who has said that. Hell, the official PHP site has Smarty, a template engine.

    Come on... there are some valid gripes about PHP, no need to go make up some.

  12. Warning!! Lots of typos that stopps a learner cold by Anonymous Coward · · Score: 5, Informative

    Hi,

    I bought this book a few months ago to learn just what the title says it teaches. Unfortunately, it had many, many typos in the code examples that resulted in me being stopped cold.

    One would need to already know a lot about PHP to know what needed to be fixed. Sadly, there was no online "errata" for the errors that stopped me cold. I think there was an online errata, but it didn't list many of the errors that stopped me cold.

    It was only due to my posting the non working code online and getting strangers who already knew PHP to point out what was wrong that I was able to proceed -- at least until the next non corrected error that stopped me cold again.

    Finally, In disgust, I gave up and bought the Wrox book (by Welling?) that just came out with a second edition.

    What's sad is there is no excuse for the lack of an online errata for the errors that stopped me codl time and time again. I had the latest edition of the book.

    IMO, save your money and time -- buy the Wrox book instead and make PROGRESS learning PHP and MySQL.

  13. Despite Assurances by Oculus+Habent · · Score: 2, Informative

    Though slashdot was certain that I could:

    You can purchase Build Your Own Database-Driven Website Using PHP & MySQL, 2nd Ed from bn.com.
    Barnes and Noble assured me that, indeed:
    Not Currently Available. A new copy is not available from Barnes & Noble.com at this time. A used copy may be available from our network of book dealers.
    I cannot. There is one used copy of the book available. If they knew they had the only copy, it'd probably be on e-bay.
    --
    That what was all this school was for... to teach us how to solve our own problems. -- janeowit
  14. Your Answer: Moveable Type by aaandre · · Score: 2, Informative

    MT does just that and is widely used by the blogging community.

    There are many plugins available for it, too.

    All you need is CGI (perl) support on your server -- it doesn't require a database and the site it generates is based on static pages (partially) updated every time the admin makes a change.

  15. Best PHP templates? Smarty! by SailFly · · Score: 3, Informative

    Does anyone here use Smarty? We love it, and have found it to be a wonderful template engine.
    It has a great user manual, but I would welcome a good PHP book that deals with Smarty templates.

    smarty.php.net

  16. Re:Sounds good... by Webmonger · · Score: 2, Informative

    Your wish is granted: PHP4 has references. And I'm actually working with structures more complicated than associative arrays ATM.

  17. Re:Just how many sites need to be dynamic? by fractalus · · Score: 2, Informative

    If you've got no content, your site doesn't need to be dynamic. A static blank page will do.

    On a more serious note, it depends on what the site does. Having built a fair number of sites--both for myself and, as part of my job, for big companies--I can say there are pros and cons to driving your site from a database.

    Databases are primarily useful when you have a consistent structure to your content and you need to be able to update that content easily. When I built this site it was done from a database, but I used a script to build all the pages one time; it's a static site, because the content doesn't get updated. I'm in the process of rebuilding the main site now, and it really will be dynamic, because I want to be able to update the database with new content and have it automatically appear on the site.

    But more importantly, there are advantages from a fully dynamic site that you just can't do with static HTML. Any kind of interactivity, be it searching, multi-step forms, or even checking on financial systems like I built with this site. You can't reasonably do that kind of thing without connecting with a database.

    Sounds like this book is a good starter guide for folks looking to learn how to build dynamic web sites. It gets you to the point where you're ready to deal with establishing sessions, and once you're there, then you can really get the ideas flowing... you have to tools to do what you want, instead of being limited by what you know.

    --
    People are never as simple as their stereotypes. This applies equally to Christians, Muslims, and Emacs-lovers.
  18. Even better by Anonymous Coward · · Score: 1, Informative

    I find this manual and this one more valuable than any book. And it's free too.

  19. Wish I could say the same for Geschwinde & Sch by mnemotronic · · Score: 2, Informative

    Avoid "PHP and PostgreSQL - Advanced Web Programming" by Ewald Geschwinde and Hans-Jürgen Schönig [Sams 0-672-32382-6]. This book is infected with enough misprints and errors to render it unusable, but at 770+ pages, at least it's bigger'n yours. More 'spensive too. neener-neener-neener.

    --
    The Russians have won. They have made the world a cesspool of distrust, greed, fear and hate.
  20. Re:Help with Mac OS X? by avignonpieta · · Score: 3, Informative

    a better book to pick up would be O'Reilly's Mac OS X for Unix Geeks, which has a section on setting up a DAMP system (Darwin, Apache, MySQL, Perl/PHP/Python). Pretty cheap too, you can get it from B&N or Amazon.

  21. Couldn't find, but found some gold by candycrusher · · Score: 2, Informative
    I went to my local Barnes and Noble and Borders to see if I could find this book, given the great review. No luck.

    However I picked up a copy of Open Source Web Development with LAMP that's by the same guys that wrote Hacking Linux Exposed and it is really great. It has an extensive PHP chapter, but the real juice is in how it covers all of apache setup, perl, php, mysql, and even mason, HTML::embperl, and WML in one place. I'd never heard of it, but when I flipped through it on the shelf I couldn't put it down. I highly recomend it.