Slashdot Mirror


Web Database Applications with PHP & MySQL

Brian Donovan contributes this review of Web Database Applications with PHP & MySQL, the most recent of several books geared toward helping people use the common Linux, Apache, MySQL and PHP combination to produce database-backed websites. Read on for the review. Web Database Applications with PHP & MySQL author Hugh E. Williams and David Lane pages 563 publisher O'Reilly rating 9 reviewer Brian Donovan ISBN 0596000413 summary A comprehensive, tutorial-style roadmap for building data-driven web applications with PHP and MySQL.

PHP's speed of execution, gentle learning curve, and ease of development have contributed to its popularity, especially when teamed with MySQL, as a tool for building dynamic sites. Williams and Lane have written a thorough step-by-step guide to building web database applications with PHP and MySQL.

The Meat of the Book

Part I (Chpts 1-3) of Web Database Applications with PHP & MySQL (Web DB Apps) introduces the "Hugh and Dave's Online Wines" case study that's used to highlight the points made throughout the text and treats readers to the fundamentals of PHP, MySQL, and SQL - appropriate since the book assumes only some prior programming experience (not necessarily in PHP) and a general familiarity with HTML.

Chapters 4-9 (Part II) deal with the aspects of web application logic common to practically all data-driven sites : querying and writing to databases, maintaining state, and security. Chapter 4, "Querying Web Databases", includes a good explanation (Ex. 4-1) of the mechanics of connecting to and querying a MySQL db via PHP - numbered blocks of the example script correspond to sections in the accompanying text detailing what's happening at each point in the process (connect, query, retrieve results, process results, and close connection- unless you're using persistent db connections).

Chapter 5, "User-Driven Querying", explains how to pass data to PHP scripts using HTTP GET and POST. Although readers are initially shown parameters and parameter values being passed directly (as they are when register_globals is turned on in php.ini), the authors later explain why the same param:value pairs should instead be accessed through the global associative arrays $HTTP_GET_VARS and $HTTP_POST_VARS (the book was completed before the switch to $_GET and $_POST respectively with PHP 4.2.0) for security reasons. What the authors refer to as "combined scripts" (where the same script performs different functions depending on which, if any, variables in the GET or POST arrays, have been set, for example) are introduced and the reader is walked through the oft-used "next and previous links for query results" scenario.

In Chapter 6, "Writing to Web Databases", in addition to inserts, updates, and deletes, the authors explain one solution to the reload problem - i.e. where reloading a results page after some operation that alters the contents of the database has been performed (or even accessing a bookmarked url if HTTP GET was used to initiate the action) can potentially result in the operation being silently repeated or, if HTTP POST was used, the user being confronted with a big ugly "would you like to repost the data?" dialog. Locking (mostly how to make the best use of table-level locking) is also discussed in all of its glory. Chapter 7 deals with the validation of user input. The authors recommend and give an example implementation of dual server and client side validation (with JavaScript). Chapter 8 covers sessions (with and without cookies).

The chapter on security (Chapter 9, "Authentication and Security") mostly concerns user authentication. HTTP Authentication, managed HTTP Authentication (using PHP to validate encoded credentials from the HTTP Authorized header field), and handling your own authentication are considered, along with the security concerns inherent in stateful web apps - i.e., third party sites maliciously tricking browsers into coughing up cookies with login or session information for your site, session hijacking by feeding random session ids to the scripts until one corresponds to an existing session, etc. SSL is explained briefly.

The third and final section of Web DB Apps (Chpts 10-13) consists of a detailed examination of the guts of the wine store case study. Readers who find the commingling of application logic and html in the snippets of the wine store application discussed in the book distasteful will be gratified to know that, since publication, the authors have released a modified version of the "Hugh and Dave's Online Wines" code that uses the Xtemplate class (http://sourceforge.net/projects/xtpl/) to separate code from markup. Both versions are available in their entirety for download from the book website.

The five appendices, in turn, cover the installation and configuration of PHP, MySQL, and Apache on a Linux system, the architecture and workings of the Internet and Web, designing relational databases using entity-relationship modeling, how to define your own session handler prototypes and store session data in a database instead of files (the default), and provide an annotated list of PHP and MySQL resources (books, web sites, etc.).

The Good and the Bad

While it's clear that Web Database Applications with PHP & MySQL was written with the goal in mind of providing novice coders with a solid foundation for continued growth (or filling the niche of "handy reference" on the shelf of intermediate/advanced developers), the book manages to be comprehensive without patronizing the reader. I admit that I wouldn't have felt cheated if the authors had skipped the obligatory coverage of the history of the Internet, TCP/IP, and HTTP (Appendix B) in favor of, for instance, a discussion of web caching with an eye towards building cache-friendly apps, an important subject that all too gets short shrift from authors of web dev books. Also, some readers may be disappointed to find that the chapter on security doesn't relate to battening down your site against script kiddies and exploits, but that's really the sort of information that you should be getting from sites like PHP Advisory and Securiteam anyway.

For seasoned developers, this could be the book that you wish you'd had when you started out building web database apps and data-driven sites. Keeping a copy around for reference, especially if you frequently jump back and forth between projects in different languages/environments, also might be helpful - for those occasions when you need of a quick refresher in PHP/MySQL dev. Moreover, if you find yourself in the position of having to mentor junior developers (or helping non-coder friends) tasked with building or maintaining PHP/MySQL-based sites or apps, then lending them your copy or recommending that they buy their own could save you quite a bit of time and frustration.

Table of Contents
  • Preface
  • Part I
    • Chapter 1. Database Applications and the Web
    • Chapter 2. PHP
    • Chapter 3. MySQL and SQL
  • Part II
    • Chapter 4. Querying Web Databases
    • Chapter 5. User-Driven Querying
    • Chapter 6. Writing to Web Databases
    • Chapter 7. Validation on the Server and Client
    • Chapter 8. Sessions
    • Chapter 9. Authentication and Security
  • Part III
    • Chapter 10. Winestore Customer Management
    • Chapter 11. The Winestore Shopping Cart
    • Chapter 12. Ordering and Shipping at the Winestore
    • Chapter 13. Related Topics
  • Appendix A. Installation Guide
  • Appendix B. Internet and Web Protocols
  • Appendix C. Modeling and Designing Relational Databases
  • Appendix D. Managing Sessions in the Database Tier
  • Appendix E. Resources
  • Index
You can purchase Web Database Applications with PHP & MySQL from bn.com. Slashdot welcomes readers' book reviews -- to submit yours, read the book review guidelines, then hit the submission page.

91 of 275 comments (clear)

  1. don't need a book by matt4077 · · Score: 2, Interesting

    the online documentation at php.net and mysql.com is excellent, so beginner books are unneccessary.

    1. Re:don't need a book by Pi+Kapp+142 · · Score: 2, Insightful

      I disagree, lots of people who are beginners would not know where to begin when trying to use PHP or MySQL. The documentation is great if you already have a basic understanding of what is going on, otherwise it is like Latin to y ou. Examples of what can be done lets you see why certain things are set up the way they are for a given language.

    2. Re:don't need a book by Antipop · · Score: 2

      I agree. It took me about an hour of looking over the PHP docs to get basic syntax down. Later that day I was writing a complex backend system for my website. PHP docs are extremely good. The function reference is so useful I wonder how I would get along without it.

      Thumbs up for the people working on the PHP docs. They have made my life so much easier. I don't see why anyone would ever need a book for PHP.

  2. I've said it before by wbav · · Score: 5, Informative

    And I'll say it again. The best way to learn php is through the php website. Go through all the documentation. You will learn more about what actually works and what doesn't than what a book can tell you. A book is always about a version behind PHP, and so learn it through the website.

    That's how I learned php 3 years ago, and well, I'm better with php than most.

    --

    =================
    Unix is very user friendly, it's just picky about who its friends are.
    1. Re:I've said it before by dimer0 · · Score: 4, Insightful

      That's like saying that reading the dictionary is the best way to learn to speak English.

      You need something that puts pieces together, puts things in perspective, gives you a 10,000 mile high view and drills down into certain aspects of what it's trying to cover. .

      Just being devil's advocate. I learn from source code. After that, I hit websites that dive deep into the subjects (like the main php site), and finally I'll take a college course (community college, mostly) on the subject just to get it on paper that I know it.

  3. Amazing... by PepsiProgrammer · · Score: 3, Funny

    I was able to download this book off kazaa in PDF form 3 days ago

    --
    "The United States has no right, no desire, and no intention to impose our form of government on anyone else." - Bush 05
  4. I really wish... by Clay+Mitchell · · Score: 2

    there was better PostgreSQL support out there. While MySQL is *ok*, PostgrsSQL beats the tar out of it. It supports good old standard SQL syntax, while I have to go look up functions in MySQL. Of course, everything supports MySQL, but it's tough to find apps that support PGSQL. Regardless, my current development platform of choice is JAVA/J2EE + PostgreSQL. That's what I coded Squabble in. I just wish there was more Open Source stuff out there for Java related stuff...

  5. Another great book on the topic by essdodson · · Score: 2, Informative

    I recently completed an elective course that was taught around the book "PHP and MySQL Web Development" by Luke Welling and Laura Thomson. I suggest giving this book a good look. ISBN : 0672317842

    --
    scott
    1. Re:Another great book on the topic by intuition · · Score: 2

      I second the recommendation for :

      PHP and MySQL Web Development

  6. Re:It's amazing how far this language has come by LetterJ · · Score: 4, Interesting

    PHP didn't start out as a Perl script it was a series of little C programs.

  7. Re:The Web is Dead by LetterJ · · Score: 2

    PHP has an experimental .NET extension and I'm sure several of the others if not all will have one soon if not already.

  8. Re:LAMP systems by LetterJ · · Score: 2, Interesting

    And WAMP (Windows, Apache, MySQL and PHP) is a lot more popular than most Linux users will admit. It's a great solution for small intranets. With the improvements in Apache 2 to make it more stable on Windows, it's works well when OS isn't a variable in the equation, but a constant.

  9. Re:Using PHP and MySQL for a website... by LetterJ · · Score: 2, Insightful

    Of course. Because we know that EVERY website gets 100s of simultaneous connections per second. As a matter of fact, all websites NEED 3-tier load balanced solution with an enterprise database in order to pull SELECT * FROM content WHERE id = $content_id out of that database 100 times per day.

  10. Real Programmers Learn By Doing by kzinti · · Score: 5, Insightful

    And I'll say it again. The best way to learn php is through the php website.

    I've said it before and I'll say it again: the best way to learn a language is by using it. Sit down at a computer with the manuals and start slinging code. You can't really learn a language by reading a book or going to a class. Real programmers learn by doing.

    If you want to supplement your programming with a book or tutorial, fine, but keep your fingers on the keyboard. If you want to run sample programs, fine, but experiment and play with them. Change them, tweak them, go off on your own tangents. Better yet: throw out the tutorial as soon as you can write "hello world" and try to write some program of your own design. Keep the language and library references handy, because you'll need to refer to them often, but let your imagination and curiousity be your guide. Explore. Play. Learn. Real programmers learn by doing.

    What I tell you three times is true.

    --Jim

    1. Re:Real Programmers Learn By Doing by mooman · · Score: 5, Insightful

      Better yet: throw out the tutorial as soon as you can write "hello world" and try to write some program of your own design.


      This strategy works fine if you never want to be any better than a good programmer (at least in that particular language). Learning by doing is great for getting started but leaves you a far cry from being someone that I'd want to hire.

      As someone who has been through close to a dozen different languages, I've come to realize that the syntax is one of the easier things to pick up when learning a new language. What you need guidance on is about best practices in your new language.

      It's the old "when all you have is a hammer, everything looks like a nail" dilemma. Just because the using lists is a convenient data structure in, say, ColdFusion, doesn't mean it should be what you reach for first in "language X". This is especially true when maker bigger leaps from compiled to scripted languages (what? Verbose comments slows things down??) and procedural to object-oriented languages. Some of the (sorry, I gotta say it) paradigm shifts are key to writing optimized code in the new language. And you'll never grasp those through trial and error.

      So while I'll agree on the point that you have to have some hands-on to master a language, I'll strenuously object to the idea that hands-on can replace a good book (or other training source).
      --
      In the Portland, Ore area and like card games? Check out: http://groups.yahoo.com/group/portlandgames/
    2. Re:Real Programmers Learn By Doing by Jason+Earl · · Score: 3, Insightful

      I agree wholeheartedly that it is important to learn the best practices of any given language. Syntax is easy to learn, but knowing the syntax to a programming language doesn't make you a good programmer any more than being able to write and spell makes you Shakespeare.

      That being said, the PHP manuals are an excellent piece of work. It is my opinion that they are largely responsible for the popularity of PHP. I have used web development systems that I feel are superior to PHP, but I have yet to see anything that is both as easy to use as PHP and as well documented. Between the PHP manual, the PHP mailing lists, and the vast wealth of freely available example PHP code, I just don't see the added value of a book. The manual is more than enough to teach you the syntax, the tutorial will get you started on the correct path, and lurking on the mailing list is as likely as anything to teach you to use PHP properly. If you really get stuck, chances are good that you can examine a working example from some other production quality product.

    3. Re:Real Programmers Learn By Doing by Afrosheen · · Score: 2

      Judging by your home page (the counter doesn't even work) I don't think I'd want you to hire me.

    4. Re:Real Programmers Learn By Doing by FyRE666 · · Score: 2

      "This is especially true when maker bigger leaps from compiled to scripted languages (what? Verbose comments slows things down??)"

      Not sure which scripting language you're referring to here. Even Javascript is now compiled and cached by browsers, so the pre-compiled version is used upon reloads (you can test this by running a benchmark script - the first run will take fractionally longer than all subsequent runs). I'm guessing perl doesn't fair any worse for having comments here and there.

      A few years ago you would have been right though...

    5. Re:Real Programmers Learn By Doing by AppyPappy · · Score: 2

      The best way to learn is to have someone dump a PHP system on you before they leave. You learn quickly when people start hauling out promises that were never delivered or scream about devastating problems they ignored a month ago.

      --

      If you aren't part of the solution, there is good money to be made prolonging the problem

    6. Re:Real Programmers Learn By Doing by Afrosheen · · Score: 2

      That's one of many champion. The real page is at http://tuxbox.by-a.com/mdk_rpms or http://tuxbox.by-a.com/proftpd-howto or http://supermame.by-a.com . Thanks for visiting my amiga page :)

    7. Re:Real Programmers Learn By Doing by namespan · · Score: 2

      Learning by doing is great for getting started but leaves you a far cry from being someone that I'd want to hire.

      As someone who has been through close to a dozen different languages, I've come to realize that the syntax is one of the easier things to pick up when learning a new language. What you need guidance on is about best practices in your new language.


      True.... but the nice thing about the PHP docs is that they have this stuff in it. The user comments in the documentation are frequently filled with snippets of code, and the docs themselves often have some. Best practices? There might be some out there I don't know about... but I like how user input and the maintainers seem to keep good practices a part of the PHP docs.

      --
      Libertarianism is rich wolves and poor sheep playing gambler's ruin for dinner.
    8. Re:Real Programmers Learn By Doing by Tablizer · · Score: 2

      (* [The best way to learn php is through the php website.] I've said it before and I'll say it again: the best way to learn a language is by using it. *)

      Stop telling people how to learn! Every head is different.

      I use a variety of approaches to learn. Websites are great for reference, but harder on the eyes than dead, pressed trees, and less portable IMO.

      It is sometimes hard to learn by doing alone because you may be doing something that works, but doing it the hard way without knowing that there is a better way.

      One a side note, one thing that bothers me about PHP is the lack of regional variables (sometimes called "globals" in web languages) without funky qualifiers. If I want to reference something often, I don't want to have to keep qualifying it. Qualifying also causes Law-of-Demeter-like re-work, or declaration rework, if you factor a local var to be regional.

      It is true that the PHP approach better "documents" a routine's interface to its surroundings, but sometimes a routine is dedicated to a particular task and I don't want to generitize it. Let it sit where it sits.

  11. Re:It's amazing how far this language has come by Skweetis · · Score: 4, Informative
    What's great is that you don't have to use a crippled database like MySQL with PHP, there's no longstanding history or anything tying the two together. Much more capable databases (Postgres, JET, Oracle) can be used with the same amount of ease.

    Amen to that. I would add a plug for ADODB or something similar for database abstraction, which makes PHP a bit more like the Perl DBI (no more separate sets of calls for each database type).

    Next, while MySQL is great for small projects (and fast), it really is just a port of SQL to dbm files, and not truly relational, so it isn't great for large projects. As you mentioned, Postgres or Oracle fill this niche quite nicely (I don't really like the Oracle model for data types, but that is my personal bias). I could be mistaken here as I haven't used it much, but isn't Jet the file format used for MS Access databases? Access never seemed very robust to me.

  12. Umm... why not just read the docs? by Hollinger · · Score: 5, Informative

    I learned all I ever needed to know about PHP from the PHP Manual. MySQL also includes a somewhat monolithic html file that provides a quick reference, as long as you know SQL.

    A useful little tidbit: If you want a quick way to look up information in the PHP Manual, go to http://www.php.net/whatever-you-re-looking-for. For example, http://www.php.net/mysql will take you straight to the reference pages for MySQL.

    1. Re:Umm... why not just read the docs? by elmegil · · Score: 2

      I don't have the money or patience for a wireless network, and I don't have the time to exert the effort to put ethernet ports in every room of my 80-year-old house. It's awfully hard to read laser printed web pages (not to mention a P.i.t.A to print them in the first place) when you're lying in bed. Printed and bound books are an excellent resource for those of us who don't spend our lives with our eyes glued to a tube.

      --
      7 November 2006: The day Americans realized corruption and incompetence weren't addressing 11 September 2001
  13. Re:Using PHP and MySQL for a website... by AllMightyPaul · · Score: 2, Interesting

    Slashdot uses MySQL. I point you to their FAQ: What kind of hardware does Slashdot run on?

  14. But MySQL doesn't do UTF-8... by andersen · · Score: 4, Interesting

    Too bad MySQL doesn't do UTF-8. That is a major problem for me in adopting it. Anybody know if that is getting fixed sometime soon?

    --
    -Erik -- --This message was written using 73% post-consumer electrons--
  15. aminamals by X_Caffeine · · Score: 5, Funny

    Chapter this, section that, blah blah, how about the important stuff: What kind of animal is on the cover?

    --
    // I will show you fear in a handful of jellybeans.
  16. Book has a missleading title by Neil+Watson · · Score: 5, Informative
    While I like O'Reilly and have many of their books, this one was disappointing. It should have been called "Building E-Commerce Applications with PHP and MySQL" as most of the book focuses on building an online shopping site.


    If that's what you want then it's a good book. If you just want a general overview of the different sites you can design using the php/mysql combination then I think you'll be disappointed. I was.

    1. Re:Book has a missleading title by elmegil · · Score: 2

      I'm writing on web-based lab equipment reservation tool with PHP & MySQL and this was one of my main references. It was just fine. Just because they don't hand you your app on a platter doesn't mean it's only good for people who want to build E-Commerce sites.

      --
      7 November 2006: The day Americans realized corruption and incompetence weren't addressing 11 September 2001
    2. Re:Book has a missleading title by neafevoc · · Score: 2, Informative

      I checked out WROX's Professional PHP4. It had everything I wanted to do... create an email and news clients. It deals how to make an FTP client. It talks about use with MySQL and PostgreSQL. I found it rather helpful (along with php.net's documentation and user notes). Bah, here's an overview.

    3. Re:Book has a missleading title by ceejayoz · · Score: 2, Insightful

      Correct me if I'm wrong, but isn't an e-commerce application usually a "web database application"? Have you managed to make an e-commerce site that doesn't use a database?

      The techniques learned from making an e-commerce site can be applied to just about any database-based site.

  17. Transactions? by rochlin · · Score: 4, Insightful
    Does this book include anything on transaction processing?

    Since transactions are a relatively new part of MySQL (and so, presumably new to PHP's interface to MySQL), a good part of the value of a new book on the subject of PHP/MySQL website building would relate to that new feature (which would also help with the double-entry problems mentioned in the review).

    So, does the book cover this topic or not? I can't tell from this review.

  18. I *hate* DB programming in PHP! by Just+Some+Guy · · Score: 3, Informative
    In my opinion, PHP just isn't worth the hassle if you're going to be doing a lot of database work. Why? Because no two database interfaces in PHP have the same syntax or featureset! My company was switching a site from InterBase to PostgreSQL and we had to completely re-write the backend routines from scratch:

    • The InterBase DBI requires you to fetch rows sequentially: while($row = $result->fetch_row){ print "
      $row->firstname\n";}
    • The PostgreSQL DBI requires you to fetch rows by index number: $maxNum = $result->rows; for($i = 0; $i < $maxNum; $i++) {$row = $result->fetch_row($i); print "
      $row->firstname\n";}
    • The InterBase DBI allows you to use case-insensitive hash keys: $row->FOO or $row->foo
    • The PostgreSQL DBI requires that the hash key case be identical to the database field name: $row->tableOneISStRaNgeLYCapPED


    If you're starting with a new project and know for a fact, beyond the shadow of a doubt, that you'll never be changing database backends, then PHP isn't too bad. If there's an possibility (however remote) that you'll ever move from, say, MySQL to PostgreSQL, then DO YOUR WORK IN PERL! I can't tell you how much I missed Perl's DBI::DBD modules - I could've completed the transition in an hour or two instead of weeks. I know that there are efforts to provide similar functionality in PHP, but it just isn't to Perl's level yet.
    --
    Dewey, what part of this looks like authorities should be involved?
    1. Re:I *hate* DB programming in PHP! by the_radix · · Score: 3, Interesting

      Actually, I just migrated a database-driven website from MySQL to Oracle without a hitch, all using php.

      A database abstraction layer was used which made all the difference. I used dal, which is a nice object-oriented layer that only involves changing a single line of code to change different databases.

      Personally, it sounds to me like your company's problem was bad design (not allowing for expansion) rather than php.

      --
      This .sig is either false or a paradox.
    2. Re:I *hate* DB programming in PHP! by Just+Some+Guy · · Score: 2

      Unfortunately, the project was started before any of the current abstraction layers existed (or were usable, at least). Either you used PHP's builtins, or you didn't connect at all.

      Were we to start now I would do things much differently, but I still contend that by the time you've started installing abstraction layers, etc., then you might as well use Perl from the beginning.

      --
      Dewey, what part of this looks like authorities should be involved?
    3. Re:I *hate* DB programming in PHP! by MattRog · · Score: 2

      You can easily write a class (or find many online) to handle DB abstraction like Perl's DBI. It's just not included like the DBI is.

      But I'm surprised you would think a DBI layer would absolve you from lots of work in changing DB backends?

      Changing RDBMs' isn't something you do every day, nor should it be taken lightly. Expecting to not have to modify code (which is a reason I hear all the time for DB layers) is false for several reasons:

      1) For all but the simplest SELECT statements most RDBMs' SQL implementation differs enough that you'd have to re-write your complex queries. As shown in your example of transactions, Oracle uses sequences to create auto_incrementing integers. MySQL uses a column type of 'auto_increment' and requires you to explicitly insert NULL. Sybase and MS SQL use IDENTITY columns but requires that you leave the identity column OUT OF the SQL statement.

      2) You should check EVERY SINGLE QUERY to make sure it performs well in your new environment. Oracle may use an index (or two) in a situation when MySQL will table-scan, causing your query to take 200x as long to complete. Switching your backend DB should not be a 'fire and forget' situation!

      3) Most Enterprise RDBMs' include the concept of Stored Procedures. These, actually, are a GREAT way to achieve DB independence (to some degree) in your application. For example, say you have some code like this: *_query( "get_user_info $userid" ); As long as my stored procedure is named the same, takes the same parameters, and behaves in the same manner I don't have to change that line at all! I can write the SQL in Oracle's PL/SQL, Sybase/MS SQL's T-SQL, etc. and the application logic does not have to change.

      However, DB abstraction layers are nice since you can include error checking and array-fetching as you showed very easily. I'd say the greatest advantage to using an abstraction layer are the class functions you create for it. I use DB layers on all my programs for those reasons, NOT for DB independance.

      --

      Thanks,
      --
      Matt
    4. Re:I *hate* DB programming in PHP! by mborland · · Score: 2, Interesting
      I *hate* DB programming in PHP!

      Me too. I uninstalled PHP a while back. The database-specific functions exemplify what is both good and bad about PHP.

      BAD: Nothing is really object-oriented. Code is completely un-portable. PHP code is useless in other environments like binary or batch development (unlike Java, VB, C++, etc...and no whining about how someone's made a PHP->binary compiler...it ain't the same.)

      GOOD: Nothing is really object oriented. Each of the modules (one hopes) is stripped down and about as fast as possible. In the case of database access, you're opening native connections directly the database instead of wading through ADO/ODBC/JDBC or any of the other things that abstracts your access. Another example, mailing functions...works DAMN well, and is as simple as can be (ASP, Java obviously can do it...but) from both a programming and functional standpoint.

      So I suppose I'd use PHP if I had a moderately small site that I wanted to use for a fairly specific purpose, one that once I'd built I wouldn't have the time to port to something else anyway. However, if the site was something that would be maintained by a large number of people, over a long period of time, and have to integrate with a variety of databases and such, I sadly wouldn't consider PHP for a second.

    5. Re:I *hate* DB programming in PHP! by Lando · · Score: 2

      Hmmm,
      Comparing PHP with Visual Basic might not be too far off. Basically the reason I started writing in PHP was that mod_perl was not available at the time and kicking off cgi scripts was becoming a royal pain in the butt.

      PHP is a focused language though and doesn't have the full functionality of perl, but then again it is easier to pick up than perl. I'd agree.

      As for MySQL comparied to access. They aren't compariable in the least... First and formost MySQL is a database something that I wouldn't even consider Access for. Access is slow clunky and doesn't or at least didn't support SQL standards. MySQL is one of the fastest databases available currently, for most sites it can do anything that they require.... The only thing Access has going for it is the user interface... The tools for developing new databases quickly for non-admins can be helpful at times..

      Hmmm, sorry for the lack of details, but while I think your comparison of php and vb is reasonable, access just doesn't compare to mysql as a database.

      --
      /* TODO: Spawn child process, interest child in technology, have child write a new sig */
    6. Re:I *hate* DB programming in PHP! by eddy+the+lip · · Score: 2
      Were we to start now I would do things much differently, but I still contend that by the time you've started installing abstraction layers, etc., then you might as well use Perl from the beginning.

      My first thought when I saw the Xtemplate class was "hmm...this looks a lot like what I used to do with perl and Sam Tregar's (excellent) HTML::Template module." I say "used to" because there were a couple of projects around here that had PHP/MySQL as a requirement, and by the time those were done we had a large reusable code-base....and here I am, slinging PHP instead of my beloved Perl.

      There is one thing that makes PHP more attractive for me. We deploy sites on hosts all over the place - we never know what's going to be installed. When you're using Perl, you never know what you're going to be able to use - is DBI installed, AnyDBM, anything? With PHP, you know you've got a database, and there's a 99% chance it's MySQL.

      One thing I'm really looking forward to with Perl 6 (to go on a tangent) is this promise of SDKs...if sysadmins can just grab the "Web Site Development SDK", I may yet get to return to it.

      --

      This is the voice of World Control. I bring you Peace.

    7. Re:I *hate* DB programming in PHP! by Just+Some+Guy · · Score: 2

      Zope is a right server-scripting choice for a serious web-project.

      You're preaching to the choir. My client is consolidating several web and database servers, and their webapps are variously running against InterBase, PostgreSQL, and MySQL.

      Today I moved a whole site from MySQL to PostgreSQL by adding a ZPsycoDA adapter and pointing the ZSQL object at it. After 10 minutes of work, I'm done, and the site works flawlessly.

      --
      Dewey, what part of this looks like authorities should be involved?
    8. Re:I *hate* DB programming in PHP! by pi_rules · · Score: 4, Insightful

      A database abstraction layer was used which made all the difference. I used dal [sourceforge.net], which is a nice object-oriented layer that only involves changing a single line of code to change different databases.

      Personally, it sounds to me like your company's problem was bad design (not allowing for expansion) rather than php.


      Thank you! I am absolutely sick of developers blaming PHP for being bad at switching databases because they didn't built their app properly. PHP lets you get right down to the raw nitty gritty DB specific stuff -- which is nice, but you really shouldn't ever be using those UNLESS you are writing a wrapper, or really don't care about database independence. I really wish the php.net official manuals would warn new developers of this.

      The very fact that this book targets PHP and MySQL sort of ticks me off too -- why not PHP and DB wrappers? Why MySQL of all things too? It's horrid (sorry) ... for large scale sites IMHO.

    9. Re:I *hate* DB programming in PHP! by horza · · Score: 2

      Code is completely un-portable.

      The code is interpreted so how can it not be portable?

      PHP code is useless in other environments like binary or batch development (unlike Java, VB, C++, etc...and no whining about how someone's made a PHP->binary compiler...it ain't the same.)

      Again can you explain more clearly? I use PHP for batch processing without any problem. You can also use PHP to write command line or desktop apps, though it's obviously not suited to developing large desktop apps as it wasn't designed for that.

      So I suppose I'd use PHP if I had a moderately small site that I wanted to use for a fairly specific purpose

      This is what PHP is primarily designed for, imho. I think you needed to read the instructions on the side of the tin before purchasing...

      Phillip.

    10. Re:I *hate* DB programming in PHP! by Malcontent · · Score: 2

      "you can't port your code to different databases without serious rework because there's no database abstraction."

      Well this is mostly a lie. There is no database abstraction layer in PERL either DBI is a library. There is no database abstraction layer in VB or C++ either ODBC and ADO are libraries. Same with python.

      So what you meant to say was that as far as PHP is concerned it's no different then VB, PERL, python, or C++ when it comes to database abstraction. You have to download and use some external library.

      "Finally, yes, we agree about the smaller site use for PHP"

      If you are hack then all you are going to do is small sites anyway (and bad ones at that). The fact remains that there are some HUGE sites that use php. You might want to look at sourceforge or insight.com as examples. PHP provides you with everything you need to build large complex web applicatons that are object oriented and easy to maintain. Maybe you ought to look into some of the more advanced aspects of it.

      --

      War is necrophilia.

    11. Re:I *hate* DB programming in PHP! by fferreres · · Score: 2

      (something the Java guys obsess over, something the Microsoft guys and the PHP guys don't seem to consider much).

      All the Java apps I have tried run so slow I can't even use them. Great, It's well designed and I *could* run it anywhere, but would I *want* to?

      I am talking about LimeWire, Phex, PanoTools and apps of that size (well, Panotools is great, as slow as irreplaceable).

      --
      unfinished: (adj.)
    12. Re:I *hate* DB programming in PHP! by Tablizer · · Score: 2

      (* MySQL is one of the fastest databases available currently, for most sites it can do anything that they require.... The only thing Access has going for it is the user interface... The tools for developing new databases quickly for non-admins can be helpful at times.. *)

      There is a web-based interface to MySQL called PhpMyAdmin (do a web search). I think it is OSS. It is a little clunky, but it beats the MySQL command-line. (I don't have anything against command-lines in general, I just don't like doing DB management on one. Rows and columns are best managed using rows and columns.)

    13. Re:I *hate* DB programming in PHP! by Lando · · Score: 2

      phpdatabase is a great little script, but it really doesn't provide the functionality of access.... Grin

      Actually I used to be a MCP in access 94-97, Most of my knowledge of access and the jet database comes from that time... Until Microsoft came out with MSSQL 7.0 they didn't have a proper database, and I doubt that they have put that technology into access...

      Anyway, I don't work with Microsoft products much anymore, but I do miss the ease of access. But power, flexibility, security and costs are a bit more important.

      --
      /* TODO: Spawn child process, interest child in technology, have child write a new sig */
    14. Re:I *hate* DB programming in PHP! by Malcontent · · Score: 2

      "The fact is that in PHP the built-in functions do not have similar calls (by name or in their function) between different databases...this is a good thing OR a bad thing, depending on how you look at it. That was the point of my original post."

      Apparently you are more dense then I thought. Ok let me try to explain it again. If you were using perl then you'd have to download a library called DBI. This library enables you to write database independent applications. If you were using Visual Basic, C, C++, python etc you'd have to do the exact same thing.

      If you are using PHP and wanted to write database independent applications you'd have to do exact same thing. You'd download phplib, PEAR, ADODB, metabase or any database abstraction library and write your application. I am of course presuming that someone of your intelligence level can actually seek, find, download and install libraries for PHP. I am making this presumption because you are so far exhibiting profound ignorance of the existance of these types of libraries. I hope that this post can ease some of that ignorance. If you need the URLs of where you can download these libraries please ask and I will gladly help you out.

      " I will look more at PHP, although if most developers are as ire-ridden as you I doubt I'll join that community."

      I don't think anybody will cry if you decide to use something else. The PHP community is thriving despite your absence and will continue to do so with or without you. Nine million web sites have decided to use it and I don't think any of us will panic because mborland doesn't like us. In fact it might be better for us if people who are unable to do simple searches on google stay away.

      However in the spirit of doing my part to ease your ignorance I would like to present you with this link. Here you will find many database abstraction layers which you can download, install and use.

      --

      War is necrophilia.

  19. phpclasses.org by djaxl · · Score: 5, Informative

    People keep mentioning php.net. I have to put my vote in for phpclasses.org. No friendly tutorials here, just the code you need. Functionality ranges from basic stuff like turning recordsets into an HTML table, to more advanced things like data caching.

  20. Big problem with most PHP Books by saberworks · · Score: 5, Insightful

    The biggest problem with all the PHP books out there is that they don't talk about software design or good coding practice. They show you some syntax and some functions and leave you on your way. Most do not discuss things like database abstraction, HTML templates, or even object-oriented programming. Without thought to design considerations such as these, most PHP programs end up being hacks full of HTML code mixed with PHP code mixed with native database calls. This might be well and good for a small script on a personal site, but when you're talking about a commercial-grade application, you really need to have all this separate. You can't expect someone to learn PHP just to change the design of their web site which uses your PHP scripts.

    1. Re:Big problem with most PHP Books by eddy+the+lip · · Score: 3, Insightful
      The biggest problem with all the PHP books out there is that they don't talk about software design or good coding practice.

      Agreed. I recently had to jump into the PHP pool, so went search for books on exactly this. I've been doing web development with perl for something like five years, know a couple other languages fairly well, and dabble in another few. So syntax and learning the language weren't an issue - I just wanted to know what the best way to use this tool was.

      After spending the better part of a day researching and perusing PHP books I settled on that New Riders title, Advanced Web Development with PHP or something (don't have the book handy, I probably got the title wrong). It was written by a couple of core developers, had some stuff on the back on developing PHP itself, and a sample application or two.

      Unfortunately, the book really lacked focus. No best practices were extrapolated from the example code, and only the vaguest nods toward larger architectural issues were given. It wasn't entirely useless, and it did smooth out one or two learning bumps, but it wasn't worth the cover price.

      This seems to be a common unfilled niche, at least in web-related development books - titles aimed at the experienced developer who wants to get up to speed on a new tool fast, with a minimum of "this is what a TCP/IP stack is" or "here's how you use a for loop". I don't know, maybe it's because it's harder to write a good book dealing with larger, real word issues, than it is to just reprint the function reference.

      --

      This is the voice of World Control. I bring you Peace.

    2. Re:Big problem with most PHP Books by Tablizer · · Score: 2

      (* it was only once I started to learn Java that I started to pick up on "big picture thinking" and using objects to keep everything nice and neat. *)

      BullcrOOP!

      What specific software engineering problem did OO "fix"?

      OO is NOT more change-friendly. I challenge you to provide specifics. No more cliches and double-talk. Talk with code and not slOOgans.

      Where's the evidence!

      I might be an anti-OO troll, but I am a
      *correct* troll. The BS surrounding OO is simply amazing.

      Give me realistic details, and I shall slay your OO code WRT "change-friendliness". (At least break even.)

      oop.ismad.com

    3. Re:Big problem with most PHP Books by Tablizer · · Score: 2

      (* Um, I seem to remember posting something about how it helped me and not necessarily everyone, to use OO programming. Yes, it did. Even if only to provide a convenient reference for pointing to a "User" or "Company" in the application I wrote. *)

      Well, let's see it. Without scrutiny, how do you know that your approach is the *only* way to acheive whatever it is you acheived? I have seen other OO fans do stuff where it was discovered they were not very good procedural/relational programmers (or using lame languages), and attributed their lack of skill to the paradigm being faulty.

      I am not saying that you necessarily fit that profile, but that without seeing it, one cannot rule it out.

      (* Besides that, it sounds like you have other problems pent up inside you. *)

      OO is overhyped regardless of whatever "pent up" problems I might have. I never see good evidence; only vague cliches, mantra, and toy examples that don't fit change-patterns of the real world.

      I will agree that *some* people may think better under OO, but one should not extrapolate that to all developers unless good objective evidence is presented for its alleged superiority.

      Getting around personal weaknesses and/or bias of either party is why I want to see actual examples of OO being "better" than p/r. That way neither side has to take the others' word for it.

      You game?

  21. ADO for PHP by Kamel+Jockey · · Score: 4, Informative

    As someone who does database coding for PHP nearly everyday, I must say the ADO interface that can be found here has been a godsend. It makes it so easy to create database independent code with minimal overhead. Of course, this package is open source :)

    --
    In case of fire, do not use elevator. Use water!
    1. Re:ADO for PHP by hendridm · · Score: 2

      You can access ADO as a COM object as well.

  22. Rasmus' is the best PHP book I've ever read, by TheTomcat · · Score: 3, Informative

    I just finished reading Programming PHP, Rasmus Lerdorf's latest co-authored book.

    It's by far the most concise, useful, and down-and-dirty books I've ever read on PHP. Even the usually-useless PHP function reference in this books is a step above the norm.

    The book talks about important things like PDF creation, the GD library, and how to extend PHP. Setting up and connecting to a DB is kept to a minimum. Kudos to the man.

    S

  23. Database abstraction classes are available by UsonianAutomatic · · Score: 3, Informative

    Not sure if these are the efforts you're referring to but they're available for some of the more widely used backends (MySQL, Postgres, DB2, ODBC).

    Yes, there are arguments to be made against DB abstraction layers if you're using very specific features on one platform that might not be available on another (e.g. Postgres' foreign keys and subselects vs. Mysql's lack of them (er, last time I used MySQL anyway))

    But if you're doing fairly run of the mill SQL stuff, check out the PEAR DB class or ADOdb. Either one implements a standard set of methods for interacting with databases regardless of the backend.

  24. question - not trolling by Ender+Ryan · · Score: 2, Interesting
    I am curious, what does PHP offer that Perl does not? I'm not trying to troll, or start a flame war, I just honestly don't see what PHP gives me.

    One thing I see people say is that it can be imbedded into your html, but you can do that with Apache::ASP, and a bunch of others, I wrote one myself for my current job.

    Plus, with mod_perl, you can write your own handlers in Perl, which is really great, not sure if you can do that with PHP...

    But the number one advantage with Perl, IMHO, is the CPAN.

    I just don't see what PHP offers that Perl doesn't already do better.

    Now, please folks, I'm interested in hearing what PHP actually offers, I'm not looking for "Perl looks like line noise" or "PHP is Perl for girlies" type comments.

    --
    Sticking feathers up your butt does not make you a chicken - Tyler Durden
    1. Re:question - not trolling by FamousLongAgo · · Score: 2, Interesting
      For me, the main advantage of PHP is precisely that it has a subset of the features Perl offers. For writing web applications, it is often very handy to have a simpler syntax and fewer builtins - it makes it easier to manage code, removes the temptation to obfuscate, and makes it a lot easier to teach others how to code the web app ( a consideration for me, working with lots of student assistants). For most web applications, you need to basically do just the following:
      • Keep track of users and sessions
      • Print the results of database queries
      • Update a database
      • Use conditional logic to select what kind of HTML to display

      For that stuff, Perl is overfeatured. Using PHP is simpler, you can embed it in your HTML with the syntax, and it makes for faster development.
      For serious text processing, you can always exec perl programs, or pipe output/input to Perl daemons.

      All that being said, mod_perl is wonderful, too, especially if you know the language already, or have a really complex web app.

      Right tool, right job, etc.
      --

      A customer service representative will be with me shortly.
    2. Re:question - not trolling by gimpboy · · Score: 2

      i tend to agree with you. i stared out using php and gave it up for all the stuff in cpan. i commented on it recently here:

      comment

      if someone posts a link to pear, keep in mind it's nowhere near as polished and feature rich as cpan.

      --
      -- john
    3. Re:question - not trolling by horza · · Score: 2

      One argument that is often brought up (in my experience) for not starting a project in Perl is that there is no rigid style guide. A C programmer can write in in C syntax, a shell programmer in shell syntax, etc. It's too flexible for its own good when it ends up in the maintenance phase. After seeing many peers suffering fixing unwieldy Perl scripts I even avoided going on any Perl training course. PHP is much simpler and has a reasonably rigid syntax, which makes it far easier to cast your eyes over and absorb strange code.

      The PHP vs Perl comparison reminds me of the C vs C++ one. The former of each is simple, almost a complete subset of the latter, and is appreciated by many as being easy to maintain. The latter of each is touted as more powerful, better OO, wider range of classes, but turn out more complex code having a higher maintenance cost.

      Much like C and C++ co-exist today, PHP and Perl can also. For simple web apps, PHP is perfect. Those that know Perl can continue to use it, there is no great incentive to change. Then for sites that need massive scalability there is Java. If you know Perl, why not have a play with PHP? It's one more tool to add to your arsenal.

      Phillip.

    4. Re:question - not trolling by eddy+the+lip · · Score: 2
      I am curious, what does PHP offer that Perl does not? I'm not trying to troll, or start a flame war, I just honestly don't see what PHP gives me.

      I've been using perl for web development for some time, and just this spring started using PHP. I'd looked at it as an alternative in the PHP3 days, but the lack of database abstraction turned me off. The language has come a long way since then, but there are a number of things I find awkward about it. The reason I've mostly switched to PHP (for the moment) is because a) a couple of projects that had PHP/MySQL as a requirement came up, and b) by the time those were done, I had a large reusable code base that did pretty much what I'd been planning to do with perl only a few months ago. I've got much more experience with perl, though, so add the appropriate amount of salt.

      First, as far as I can tell, PHP doesn't give you any functionality that you don't get in Perl. I frequently find myself doing a lot more typing with PHP than Perl would require to do the same thing.

      Second, someone here mentioned that PHP has a more focussed feature set, and is therefore easier for web development. I tend to disagree. PHP is heavily weighted towards database access, HTML manipulation, session management, etc., but at the same time there are a whole lot of functions built into the core language that, frankly, I think are superfluous. Once or twice I've come across something that I thought would be really cool if Perl had it, but my overwhelming impression was: too much in the core language. Syntactically, PHP might look easier, but if you've already mastered Perl syntax, there's no gain here.

      Third, PHP is designed to be integrated into HTML. This can become largely a religious issue, but I think that's a Bad Idea, for a whole lot of reasons. I like the HTML::Template module in Perl a whole lot because it minimizes the amount of logic you can mix in with your HTML. The Xtemplate class mentioned in this article looks like it has a similar goal, but PHP as a language encourages the mixing of code and logic. It just doesn't sit right with me.

      Fourth, (and some might consider this a non-issue) is that I just don't like using a function call for a regex match. I like Perl's binding operators much better.

      Finally, the language is not as mature as Perl. Functions are renamed between point releases (from the array_key_exists() definition: "Note: This name of this function is key_exists() in PHP version 4.06") and major changes in the default configuration between point releases (form variables no longer auto-vivified as of PHP 4.20 (yes, I know the reasons, but I'm savvy enough to initialize my variables before use, thank you very much)). Functions are also frequently named in incosistent ways. Some use underscores in them, others interspersed caps, and functions that do similar things don't always have names constructed in a similar way (key_exists vs. all the other array_x functions isn't the best example, but I don't have any others at my fingertips. I've run into a few of them, though). This isn't confidence inspiring.

      The main argument that I've heard in favour of PHP over Perl is that the length of time it takes for someone new to web programming to learn to do the same things Perl as are built in to PHP (session handling, database access, etc) is shorter. I'm not sure that I agree - I've never found it difficult to pick up a new module. But as I said, I've been using Perl for a while.

      The only advantage I've personally found to using PHP so far has little to do with the language, and more the way it's deployed. I never know where a web site I develop is going to live. Unfortunately, the vast majority of hosts seem to toss on the default Perl install and call it a day. Not being able to count on, say, DBI, is a real bitch. I could say that the site requires mod_perl, DBI, the libnet bundle, etc., but a) that gets you a lot of blank stares (yes, from hosts), whereas with PHP, I know I'm getting a database, and it's probably MySQL, and various other goodies.

      Tangent: One of my big hopes for Perl 6 has nothing to do with the language, but with the way it's deployed. I'm really hoping that a small core language with SDKs (a web development SDK with DBI, libnet, and Mason. yum) will encourage sysadmins to put more stuff I need on their servers. Untill that happens (or we start co-locing all our sites), I'm probably going to be using PHP for the bulk of our development. It makes me sad that I'm using a tool that, while workable, I don't find as powerful as Perl, still has a lot of rough edges, and with a far inferior toolbox (no CPAN) simply because what I often need isn't widely installed.

      I've gone on enough, but I hope I've given you a bit of insight into my experiences with the two tools. PHP is servicable, but Perl really helps me. If you have control over hosting environment, stick with Perl. You'll get more mileage out of it.

      --

      This is the voice of World Control. I bring you Peace.

  25. Re:Using PHP and MySQL for a website... by MattRog · · Score: 2

    Did your company evaluate products such as the Zend Accelerator?

    They seem to indicate it works well. Although our site's Case Study is a bit out-dated it still provides significant value, esp. when considering the cost of a J2EE app server and the like.

    --

    Thanks,
    --
    Matt
  26. Agreed. Another one I used: by twilight30 · · Score: 3, Informative

    MySQL/PHP4 Database Applications, by Jay Greenspan and Brad Bulger, Hungry Minds, ISBN 0764535374 .

    Welling and Thomson's book is a good reference for those who want to get to grips with practical projects straight off the bat. It includes webmail, shopping cart, session control, and web-forum/weblog applications as a matter of course, and begins with a sturdy look at PHP first, moving to MySQL once the basics are covered.

    Greenspan and Bulger's text is perhaps more traditionally concerned with constructing databases and the programming that surrounds them. Both books cover the material equally well, though I found some nuisances in the first book.

    --
    ========================================
    Death will come, and will have your eyes
    -- Pavese
  27. Re:Using PHP and MySQL for a website... by Starship+Trooper · · Score: 2

    Well, if you don't want to listen to me, let the nnumbers speak for themselves. Resin+Apache pushes out twice as many pages/sec on a database-backed site than PHP can.

    --
    Loneliness is a power that we possess to give or take away forever
  28. Re:Using PHP and MySQL for a website... by MattRog · · Score: 2

    I can attest to other products' robustness as well. We run Sybase ASE 12.5 on a dual (run-of-the-mill PIII 1GHz) CPU linux box. I am not sure what kind of traffic Slash gets, but I do know on sites which keep track of the number of online users that get slashdotted are lower than our typical user-load periods.

    Plus, we don't have to take the DB offline to perform BACKUPs and other such nonsense. Replication is better and faster, java and XML support, etc. etc.. Sometimes, not always, but sometimes you get what you pay for.

    --

    Thanks,
    --
    Matt
  29. Re:I appreciate your pedantry by crimoid · · Score: 2

    I would think that you are both correct.

    initially as a simple set of Perl scripts.......As more functionality was required, Rasmus wrote a much larger C implementation

  30. Re:PHP == Perl for girls by axxackall · · Score: 3, Funny
    Let me continue:
    • PHP is for girls
    • Perl is for boys
    • VB is for toddlers
    • C is for bikers
    • C++ is for biker-women
    • Java is for biker-managers
    • Lisp is for artists
    • Scheme is for lazy artists
    • Prolog is for mathematicians
    • Python is for construction builders
    • Tcl is monks-builders
    • XML is for hippies
    • RDF is for buddhists
    • XSL is for bishops
    • ... to be continued ...
    --

    Less is more !
  31. Re:Why Not Java? by Hiro+Antagonist · · Score: 4, Interesting

    I'm assuming that by "Java", you mean JSP; anyone who uses an actual *Java* application to implement a *webapp* needs to be shot. Repeatedly.

    That being said, there are a few reasons, actually. I do some development work in Java, but I'm also pretty well-versed in a variety of other languages; including C, C++, Perl, Assembly (x86 and good 'ole 68k), and PHP (and shell scripting, of course). Compared to PHP, JSP is a *pig*. It eats up a much larger chunk of memory, more CPU time, and is IMHO a terrible platform for developing small web-based applications. JSP+EJB does have its uses, but not in the arena of small webapps.

    This is where PHP really shines; it's very fast, has a small footprint, and is *much* easier to use and debug than JSP is.

    So, for writing huge, enterprise-level apps, JSP+EJB is the way to go. For writing smaller apps; things that need to be written quickly and securely, I'll stick with PHP.

    --

    --
    I Hit the Karma Cap, and All I Got Was This Lousy .sig.
  32. embedded perl by SCHecklerX · · Score: 3, Informative
    I prefer using embedded perl to PHP, plus you get all the goodness of mod_perl speed. You can also use any standard perl module in your web pages then. Check it out:

    http://perl.apache.org/embperl/

  33. "Gentle learning curve"? by Tim+Ward · · Score: 3, Interesting

    Why oh why can't people get this right??

    A "steep learning curve" is one where you go up, and get to the top, quickly, ie the thing is easy to learn quickly.

    A "gentle learning curve" is one that you climb up slowly over a long time, ie the thing is a right pain to learn and takes ages.

    So why do people who appear to know English get these the wrong way round? Is it perhaps that they're not illiterate, they're just innumerate and haven't a clue what a graph is?

    1. Re:"Gentle learning curve"? by horza · · Score: 2

      A "steep learning curve" is one where you go up, and get to the top, quickly, ie the thing is easy to learn quickly. [...] they're just innumerate and haven't a clue what a graph is?

      I knew even before I checked your homepage that you lived in Cambridge... where they don't have any hills. The trick to understanding the graph that you missed is that you need to stand the bit of paper on its edge. You are right about time going along the x-axis, but a steep climb is far more difficult to walk up (whether mentally or physically).

      A steep learning curve is hard too learn, but will get you there more quickly. And vice versa for a gentle learning curve.

      Phillip.

    2. Re:"Gentle learning curve"? by namespan · · Score: 2

      Because you're think speed and they're thinking effort. More probably, you're thinking like a mathemetician... a steeply rising curve is one that rises quickly. A genly rising curve takes forever.

      A steep curve has a steep slope. Sure, it rises quickly if you're just plotting height against some horizontal variation, but if you're climbing it, actual progress can be very slow inded. A gentle curve rises slowly, but is easy to move over, so actual progress can be quicker. This becomes very clear after you've done a bit of mountain hiking, and most of us on slashdot could use some time outside, so I urge everyone to try this.

      When I think steep learning curve, besides thinking of bushwhacking up Jacob's Ladder to get to Lone Peak (overlooking Salt Lake City, Heber, and Provo in Utah), I think of Finale (the music typesetting program). Holy cow, you have to fight to learn that thing.

      --
      Libertarianism is rich wolves and poor sheep playing gambler's ruin for dinner.
  34. Other option: openACS by Cirkit · · Score: 2, Insightful
    I'd like to recommend the excellent openACS toolkit. Not PHP and not MySQL (ick), but a mighty fine, totally open source toolkit for building communities, e-commerce, etc. PostgreSQL rocks, or if you're feeling spendy, it also supports Oracle.

    The best thing about the openACS toolkit is that you can have a functional db-backed site up in no time. No need to re-invent the wheel. :)

  35. Re:Well by GutBomb · · Score: 2

    i got that one along with "core PHP programming" I had only done some vb programming before and ASP alsu using vbscript, so it was a good intro to PHP/MySQL. "Core" is a decent reference, but i find myself hitting the website or oriely's "MySQL&mSQL" as a reference more often.

  36. Re:Why Not Java? by GutBomb · · Score: 2

    if the designer can't deal with a and some spread around in the content, they should not have a job as a designer. you can keep all of the logic in an include file that you call, and have the bulk of the file the designer gets as the HTML.

  37. Web Applications by namespan · · Score: 2

    Has anyone tried to write a generalized web application framework (or even server) that uses PHP? I appreciate the PHP database and session stuff, but sometimes it would seem if there was a framework that was a little bit beyond this, I could save some time.

    Yeah, I could write one myself (and in fact I am), but I'm thinking I can't be the only one thinking about this.

    --
    Libertarianism is rich wolves and poor sheep playing gambler's ruin for dinner.
  38. zope stats by mgkimsal2 · · Score: 2

    Give me stats please - I can never find anyone who gives actual numerical benchmarks on Zope/python in terms of capacity. Give hardware numbers and sample code and benchmark results for how well it held up. 'still good enough' performance just doesn't sound all that convincing. Everything I've seen about Zope points to 'oo' database as being the primary database. People needing to interface with standard relational databases seem to be SOL - how right/wrong is that?

    'real OOP' - PHP is 'good enough' at OO for most projects (if 'good enough' is sufficient reason to use Zope, it's sufficient to argue for PHP too).

    Zope *needs* to have better presentation - we've installed it a few times and it's always confusing as sin, with no good documentation.

    1. Re:zope stats by cjpez · · Score: 2
      Zope actually makes dealing with plain ol' relational databases REALLY easy. The primary database is, yes, OO, but I've built quite a few applications in Zope that deal primarily with a relational database. The OO stuff is really great for programming the actual application, and then the data can get stored away in the relational database. Really cool funky application stuff.

      I do agree about documentation, however. I'm a total Zope freak; I think it's by far the best application server environment out there, but the documentation has always managed to be really boggling. There's this really bizarre learning curve involved, and for some reason they've never seemed able to get past it. Once you understand Zope, it's great, but if you don't it can be pretty hellish. At least the mailing lists are generally good sources of info if you make some effort to sound like you know *sort* of what you're doing. :)

      As to benchmarks and stuff, I know that there were some tests done some time ago with Zope vs. Tomcat vs. something else, but I've long since lost the links. Search the mailing list archives, should be in there. (Of course, as the advocate, I should really be the one supplying the links, eh?)

    2. Re:zope stats by mgkimsal2 · · Score: 2

      Not to press the issue too much but...

      If the stuff is pulled from and stored to a relational DB, why not just use a language which is more suited to dealing with relational stuff? Zope seems to thrive on OOdb stuff, and the relational, while possible, is an 'oh yeah, that too' thing (again, talking appearances).

      Yes, you should supply the links. :)

      Comparing against Tomcat - at least earlier versions - is like shooting fish in a barrel. I'd be more interested to see it go against a BEA app, or a well-built PHP apps (not that many exist tho!) :)

    3. Re:zope stats by cjpez · · Score: 2
      Hey, press all you want! :)

      Speaking from experience, the way Zope ties into the relational databases is anything but "oh yeah, that too." It's kind of difficult to explain how the two can work together. First off, the ZopeDB really isn't OO in the way that you're thinking it is. There's many similarities, but if you try to make it work exactly like the OO model in your head, you'll probably end up banging against some walls. When you go to http://host/foo/bar/baz, "foo" "bar" and "baz" are all objects in the ZopeDB, and they aren't necessarily "heirarchical" in the way you might think. Ie, the "directory" structure could look like this:

      • foo
        • baz
      • bar
      So when Zope's rendering "baz", it'll look at baz's "acquisition path," which will look at "bar" and "foo," and depending on what those objects do, the behavior of "baz" can be radically altered. Like "baz" could be some kind of administrative plugin object, and if you simply add "baz" into the acquisition path, and instead of getting the data-entry screen, it'll launch you into an administrative version of the screen that's still being sourced from the same place, and does extra authentication and stuff.

      It's really beyond the scope of a Slashdot post to fully go into, however. :) The OO stuff is just really wicked-cool to code in.

      As for the speed thing, it is really difficult to compare just because of all that Zope's doing. For every web request you make into Zope, it'll be doing authentication, persisting changes in the Zodb, doing some version control stuff, talking to the relational database, adding up all the acquisition paths and so forth . . . It's doing a *lot,* and it makes it difficult to compare to other packages because when you get to that level of complexity it becomes harder to say which is "better." Like, something might be running faster, but you don't get all the cool benefits of Zope's object acquisition, or possibly the really fine-grained level of security and permissions that Zope has built in . . . And are the replacements in the competing package "better" or "worse?" It's really hard to say. There are things you can do in Zope, programming-wise, that would be nigh-impossible in other systems, just as there are probably things in other systems that would be nigh-impossible in Zope. So it's difficult to tell.

      But I'm rambling now. :)

  39. PHP and XML by horza · · Score: 2

    Now would be a good time to ask for beta testers of a new XML module for PHP. One thing that's been a big fault of nearly all PHP apps available is the storing of the configuration as a list of hard-coded variables (usually called config.php). This makes it difficult for the app to update its own config, and certainly reduces the chance of 3rd party config plug-ins.

    There are a couple of xml modules that are veneers onto standard XML libraries, and also a good PHP Class, but all are not that easy to use. I wanted an API that took under 10 mins to learn and be competant in. You can see it here. So simple it only took me a couple of minutes to write a XML-based guestbook. Another example is here. Install instructions are on the site, feel free to have a try and give any feedback.

    Phillip.

  40. Re: reminds me of "C Bible" = "build calculator" by fferreres · · Score: 2

    It incredible, coudn't they just make it more fun to learns something? People doesn't want to learn everything in a straight line nor accomplish a "grand proyect".

    Teaching with separate, well thought out examples (small or medium size each) is much better. The "grandmaster project" also needs to force usage of a lot of functionality that hurts the teaching and the intelect as well.

    --
    unfinished: (adj.)
  41. You don't need OO crap to wrap DB operations by Tablizer · · Score: 2

    (* [Unfortunately, the project was started before any of the current abstraction layers existed] You could have written your own. It whouldn't have been that much effort. *)

    Exactly!

    You don't even need OO. Wrap it in functions. You can also consolidate many things so that if 90% of your code uses the same database or connection handle, you don't have to keep referencing it over and over. Open them all in a single function.

    Use optional named parameters if you need to deviate from the norm (std. connection, etc.) on occasion. That way you don't clutter up 90 percent of the calls for the 10 percent that deviates. Optional named parameters are great for that kind of thing. (I haven't used named parameters yet in PHP, so I don't know if they have any limitations).

    Don't fall for all that bullshOOt that only OOP can protect you from DB vendor changes. Those OO book authors simply don't know how to use procedural/relational programming correctly. They had a bad experience in C, and tossed out the baby for OO.

    oop.ismad.com

  42. Re:COMMENT STOLEN FROM AMAZON DOT COM by Tablizer · · Score: 2

    What is wrong with that as long as it is the *same* author?

    Guilty until proven innocent?

    Psuedonames are all over the web. You don't know that they are different persons (yet).

  43. JET vs. MySQL? by Tablizer · · Score: 2

    (* What's great is that you don't have to use a crippled database like MySQL with PHP, there's no longstanding history or anything tying the two together. Much more capable databases (Postgres, JET, Oracle) can be used with the same amount of ease. *)

    JET less crippled than MySQL? (I assume you mean MS's JET. Is there another with that name?)

    It wouldn't even run if it was that bad.

    The only nice thing about JET is that it is easy to transfer the database data and schema together in one file. Beyond that, it is the royal pits.

    I wish an open-source JET-like engine and/or file format caught on. (But fixed)

  44. Stupid pedantic correction by noda132 · · Score: 2, Interesting

    As it says on the link in the review, $_GET, $_POST & co. were implemented in PHP 4.1.0 and not 4.2.0. Just in case anyone wants to compile a history ;).

    As for the book... personally I wouldn't have found it useful (based on this review) at any stage of my PHP education. The online manual is simply too good. I really don't see what else is needed - good coding practice can be figured out with common sense - a mix and match from Perl, C, and (more and more these days, especially with Zend 2) Java.

    The function reference is superb - not to mention the user-contributed notes, which as often as not have the answer to your specific question. My Galeon is, not surprisingly, outfitted with a Smart Bookmark to the function reference. Beats a book any day.

  45. Re:The Web is Dead by Tablizer · · Score: 2

    I don't know who moderated the above message down (zero), but it was uncalled for.

    They were *not* promoting MS, but merely giving their opinion that MS will kill the standards and or the market.

    That is a legitamate opinion. MS has killed other things. (I don't necessarily agree with it, but it is an understandable viewpoint based on past history.)

    Their sig also suggests that they are a Perl fan anyhow, and not an MS fan.

    Bad moderator!

  46. Re:PHP == Perl for girls by Tablizer · · Score: 2

    (* Perl is for boys *)

    Perhaps in the sense that boys bust in town, knock the girl up in wild passion, then skip town and leave a cryptic mess for somebody else to take care of for the rest of the "project".

    I don't care, use whatever language you like as long as you don't shuv it down other's throats.

    BTW, I don't like Perl's habit of using arrays of pointers to arrays to create collections. If you have to change the implemenation of the collection to get say more columns or indexes, then you have to overhaul a bunch of code. Better to wrap collections into some scalable API so that changing the guts does not create more consulting hours to line your pockets.

  47. Re:Why Not Java? by swright · · Score: 2

    I hate ASP as much as the next Linux guy here, but IIRC ASP isn't meant to be used much like that either (assuming use of VB in ASP that is). App logic should be done in COM objects and ASP/VB provides the glue between them and the HTML; just like what you said for JSP. Of course, with more capable languages under ASP thats probably not necessary.

    Ah well, I'll stick to me PHP+Postgres any day.

  48. Re:So is LAPP (Linux, Apache, PHP, PostgreSQL)! by MrEfficient · · Score: 2

    I also work in a State Personnel Department. I'd be interested in hearing about the system you're developing, especially concerning the job descriptions. Our state is also developing an online application for people to apply for state jobs. You can email me at mb_chandler@hotmail.com if you're interested in discussing it.

    --
    Check out AbiWord.