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.

33 of 277 comments (clear)

  1. This Book Changed My Life by Anonymous Coward · · Score: 4, Funny

    Before I read it I was successful and happy.

    Now I'm a tired bitter old man.

    Damn this book
    Damn this book to hell

  2. Who wouldn't? by eenglish_ca · · Score: 3, Interesting

    Who wouldn't build their own database website. Imagine slogging through hundreds of pages of fixed html. Does anyone know of sites like these other than personal pages put up by newbies? All of my sites are at least dynamic using php.

    --
    Checking out my form of escapism.
    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. Re:Who wouldn't? by jest3r · · Score: 4, Insightful

      when you actually start getting alot of traffic it is sometimes best to use static pages for as much content as possible .. of course these static pages are generated from information stored in a database ..

      opening a database connection for every visitor on every page is suicide if you only have a single server .. and your site is featured on slashdot ..

    3. Re:Who wouldn't? by jandrese · · Score: 3, Insightful

      It all depends on what you're doing. Most business pages (brochurepages) are actually quite static and would not need much automation.

      On a counterpoint, some homepages have dynamic content of some sort that you just can't do with static HTML. It's all a matter of what you're doing, not who you're doing it for.

      Also, some people put up private pages as a way of teaching themselves the ins and outs of running webpages. Those pages can quickly include all sorts of bells and whisles including dynamic content, flash, etc. Additionally, those sights can look good on a Resume since it shows the person has enough interest in the technology to play with it outside of the workplace.

      --

      I read the internet for the articles.
    4. Re:Who wouldn't? by ncc74656 · · Score: 3, Insightful
      Who wouldn't build their own database website. Imagine slogging through hundreds of pages of fixed html. Does anyone know of sites like these other than personal pages put up by newbies? All of my sites are at least dynamic using php.

      It depends on what type of content you're putting up. I wanted consistent navigation from page to page and easier maintainability; server-parsed HTML is sufficient for that task. It also allows me to serve up either proper HTML and CSS for browsers that can handle it or broken, non-standard HTML for crappy non-standards-compliant browsers. While I use MySQL for logging server activity (when I dumped access_log into the database, the database was smaller than the text file that created it), the only "content" I've ever served up from it was statistics of how many tens of thousands of times infected IIS machines had tried to pass their bugs on to my server (done with server-parsed HTML and a shell script with the query). For mostly-static content on a small to medium website, is there any reason (other than "because I can") for shoving every website into a database?

      All of my sites are at least dynamic using php.

      Such as this one, which took forever to load because the images appear to have not been optimized? Looks like invalid HTML with a big table in it.

      (Why do I get the sneaking suspicion I've just been trolled?)

      --
      20 January 2017: the End of an Error.
    5. Re:Who wouldn't? by rreyelts · · Score: 5, Interesting
      opening a database connection for every visitor on every page is suicide
      Rather, just about every serious web application requires database access, and yet they don't commit suicide. It's called connection pooling, and it is a standard feature on pretty much any application server nowadays.

      I imagine most Slashdotted sites die from network starvation long before their machines come to a grinding halt.

    6. Re:Who wouldn't? by zaxus · · Score: 3, Funny

      Of course, convincing Mom and Pop to license Oracle for their recipe website might be a little difficult....

      --
      /. zen: Imagine a Beowulf cluster of Beowulf clusters...
  3. Chapter 16 by SpanishInquisition · · Score: 4, Funny

    Avoiding the "Slahdot Effect"

    --
    Je t'aime Stéphanie
  4. The thruth is... by dfiguero · · Score: 5, Interesting

    that once you learn the basics of PHP and MySQL all books on SQL/MySQL and PHP just don't cut it. You would probably be better off with the online documentation from the respective websites and for those really though cases a PHP/MySQL Cookbook.

    --
    My penguin ate my sig
    1. Re:The thruth is... by gid · · Score: 4, Interesting

      I've run into the same thing. In fact, I've taken it one step further, I have NEVER felt a I needed a book to teach me PHP/MySQL, both projects have fantastic online documentation. If there's something that the PHP documentation doesn't tell me, chances are the user comments do. There hasn't been one feasible thing that I haven't been able to figure out with PHP or MySQL thru the online documentation.

      The interesting thing is, I've recently have had to start learning Java / JSP / PL/SQL / Oracle. Documentation is a nightmare. There just doesn't seem to be one end all be all on stop shop for my Java documentation needs, there's about 20 relevant manuals that I need to sift through to find out one thing, and there's about 20 different ways to implement your site. Ok are we going to build our own tag libraries, conform to J2EE, use java beans, just do straight jsp, on what classes should we make and for what? What stuff should be stored in PL/SQL, etc etc etc. It's crazy.

      PHP is a dream come true, ease of use wise. It may not be the fastest thing in the world since it's just a scripting language, but there's the Zend caching engine that can help quite a bit. There's just something to be said for reading PHP code from top to bottom and know exactly what's going on. And being able to pay a cheap PHP monkey to code your site for you, instead of paying an expensive Java/Oracle programmer with 10 years experience.

  5. a tad forgetful are we? by Anonymous Coward · · Score: 5, Funny
    all 295 pages of Yank's new release are of value to me on a daily basis.
    Maybe you just need a better long term memory.
  6. sounds simliar by drgroove · · Score: 3, Interesting

    to the PHP and MySQL Web Development book by Welling & Thomson, from SAMS.

    Good to see more 'tutorial' style books coming out - its the real world examples that springboard a beginner's skill level w/ a new language.

    I'd much prefer to see this type of tutorial book in the hands of a n00b than a straight-lexicon or syntax book w/o examples of actual apps you can build. Sounds like a good one, based on the review.

  7. Sounds good... by Randolpho · · Score: 3, Insightful

    ... but aren't there already a bunch of books that do this? I mean, wouldn't a more useful book be one about *designing* a database driven site? Stuff like content management, implementing full text search, session tracking, user logins, site organization and navigation, that sorta thing?

    I mean, do we really need *another* book that tells you how to program in PHP and how to use MySQL?

    Anyway, from the review, I suppose this would be a good replacement for those books. I just think what we need is something more.

    --
    "Times have not become more violent. They have just become more televised."
    -Marilyn Manson
    1. Re:Sounds good... by drgroove · · Score: 3, Insightful

      ... but aren't there already a bunch of books that do this?

      Yes, but having a choice of books is helpful to beginners; especially considering that not every author's writing style or code examples work for every budding developer out there. Choice is good. There is still plenty of room for the improvements you sighted, tho, but I don't think that lack of coverage on those concepts in this particular book denigrates its quality or usefulness.

    2. Re:Sounds good... by odyrithm · · Score: 3, Troll

      it would be nicer if people would spend a day of there life to look at postgresql... now I was one of the MySQL fanatics that hated pg.. how foolish I was.. trust me, all this hype over MySQL is totaly unjustified, postgresql is a far far better rdbms. Dont believe me? take a day to look up its features, you wont regret it.

      --
      moo
  8. 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
  9. Measurement of book length is meaningless by MarvinMouse · · Score: 5, Insightful

    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.

    Just because a book is long, doesn't mean it's useful.

    like the great quote

    The Ten Commandments contain 297 words. The Bill of Rights is stated in 463 words. The Lord's prayer has only 67. The story of creation in the Bible uses only 200 words. Lincoln's Gettysburg Address contains 271 words. On the other hand, a recent Federal directive to regulate the price of cabbage contains 26,911 words.

    I personally find, the bigger the book, the more difficult it is to navigate and the less useful it really becomes. Quick, short, to the point explanations are almost always better than long details drawn out explanations that I don't have the time or the desire to read.

    --
    ~ kjrose
  10. 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.

  11. 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!

  12. Web Database Applications with PHP & MySQL by The-Perl-CD-Bookshel · · Score: 4, Insightful

    I develop 'AMP' solutions and IMHO this book, in addition to the PHP cookbook, are the best two books you can buy on the subject. You can really tackle most any problem with these two books and if you cant, there is always IRC or as a last resort the documentation :)

    --
    I don't keep a lid on my coffee so when I walk around I look busy -me
  13. Just how many sites need to be dynamic? by British · · Score: 3, Insightful

    It seems too many websites out there have mile-long URLs(including huge session ID strings) and other gizmos only to deliver the same static content over and over again.

    What ever happened simply to static web pages that are nice and simple, and dish out the data without all that overhead?

    1. Re:Just how many sites need to be dynamic? by Animats · · Score: 4, Funny
      There are lots of good reasons for database driven web sites:
      • Easier support for "124 people have accessed this site since January 1, 2000".
      • Three words: "customized ad content".
      • A new fortune every time!
      • "Welcome back, (Your name here)".
      • Different users, different prices.
      • Kickbacks from database sales rep.
      • Job security.
  14. 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.

  15. Re:HOWTO-Build a DIY DB-driven site by mark_lybarger · · Score: 3, Interesting

    my personal preferance would be Tomcat/JBoss/Apache/postgresql. there's a lot of benefit to taking advantage of product which implement standards and even more benefit when those products are open source free as in beer and free as in speach.

  16. Which effect? by Sleepy · · Score: 3, Funny

    > Avoiding the "Slahdot Effect"

    Were you refering to the Slashdot-caused bandwidth spike?
    Or did you mean the "I can't spell" Slahdot effect?

    Sorry... it's so unclear what you meant.. :-)

  17. 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
  18. This book misses the mark by esconsult1 · · Score: 5, Interesting
    One reason why PHP gets such a bad undeserved rap, is because much of the PHP code that's written out there today is a nightmare.

    You have uncommented code with embedded HTML that is database specific. Don't get me wrong... if you have a small project that works with a quick hack, then that's ok.

    With any modern PHP project, what's wrong with using templates, PEAR, and object oriented programming? Most PHP books out there tend to spin the mantra of PHP and MySQL or Postgresql without taking the time to show how to use PHP in a modern context where it deserves to be. Thus much PHP programming gets scoffed at because it tends to be unmaintainable.

    I'm sorry, but at this point I'm unable to recommend almost any of the PHP books out there. They mostly encourange terrible PHP system development practices -- embedded HTML, database specific coding, non OOP development.

    There are a few sites that are showing the light. phpclasses.org only has OOP based PHP programs and the tools you need to use templating, mailing, databases in a thoroughly modular manner, and dont forget the PEAR site which documents and make available the excellent PEAR classes for PHP.

    A few other sites also are preparing PHP libraries and development environments that are a joy to work with.

    For PHP public www information is better that 99% of the books out there, and in the case of this book... 100%

    1. Re:This book misses the mark by tcopeland · · Score: 3, Interesting

      Hmm.... I don't question your experience... but I've found that if a server app is written using classes and such it's much easier to go back and plug in a SOAP wrapper to the "business objects".

      For example, GForge has a bunch of classes that we've wrapped via SOAP, so now a Java client can do something like:

      Client c = new Client("my.gforge.host", "myproject");
      client.login("tom,"fiddlesticks");
      Bug[] bugs = client.getOpenBugs();

      Fun stuff!

      Yours,

      Tom

  19. 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.

  20. Re:This book isn't available. by Cy+Guy · · Score: 4, Interesting
    Did you ever think abuot a LOCAL bookstore

    Well actually, most local bookstores that want to stay in business have stopped trying to beat Amazon and bn.com and decided to join them by offering used & hard to find books via their affiliated dealers programs.

    Unfortunately, just one copy of the hardback version was (sold within the last few minutes while I was writing this post) available through bn's affilliate system, and none of either edition are available through Amazon's affiliates. Though the paper back version is available through Amazon.

    If there are local stores out there that have the book available, they might want to consider selling the book through Amazon or bn.com. After all, listing (at least on Amazon) is free.


    BTW NineNine, we miss you!

  21. 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

  22. 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.