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.

275 comments

  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 Richard_at_work · · Score: 1

      That all depends on waht type of beginners they are. If they are previous coders who are moving to a new language, then the sites are enough, as thats exactly waht i did. i bought a couple of books, mainly WROX ones, and found the php ones to be shite.
      For total beginners, then yes, maybe they will need a bit more to learn the proper structure and methods, but thats more of a true beginner thing.
      Me, myself, i use these sorts of books, and articles on the internet jsut like them, to stop myself reinventing the wheel. I look at the stuff they do and then think of any projects im currently part of that will benifit from the methods and stuff.

    3. Re:don't need a book by earthpig · · Score: 1

      i hole heartedly dissagree.

      unless the have changed receintly, i 've found the online documentation for both php and mysql the most frustraing. as i beginner, i spent countless frustrationg hours getting nowhere with the online documentation.

      almost all gpl free gnu open source documentaion about as helpful as continually hitting my self in the head with a hammer.

    4. Re:don't need a book by JebusIsLord · · Score: 1

      I agree that the php.net documentation is actually pretty good, AS A REFERERNCE. I prefer to have a hard-copy text on-hand to explain how to do things step-by-step, and as a fairly novice coder I like to keep my O'Reilly Programming PHP on hand for walkthroughs and alternative methods, with php.net open in a browser window for quick function reference. Plus, I can go outside and lay in the sun with a textbook, like I am about to right now!

      --
      Jeremy
    5. 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.

    6. Re:don't need a book by vectorswept · · Score: 1

      This is simply not the case. I have found very little software on any platform that has more or better documentation than the Free Software Foundation's software If you read Perldoc or use info to find out about Linux commands you will find it user friendly and informative.

      I am not familiar with PHP's information but don't use the same brush for gnu's software.

    7. Re:don't need a book by drpatt · · Score: 1

      Same here. Anyone who can learn this stuff just from the online docs is an experienced programmer or a Einstein clone. For the rest of us, we need more. And I suppose man pages are all you need to learn Linux, right? :)

    8. Re:don't need a book by neuroticia · · Score: 1

      Not necessarily so. Documention is documention, and there are plenty of simple how-to's or tutorials and manuals online that are suitable for the beginner.

      The primary benefit of a book is the ability to bring it anywhere and read it with minimal eyestrain. For example, I can bring my book into the bathroom and catch up on some concepts that I don't use day-to-day but that I'm interested in because they might make some task easier.. Or I could bring it to the dog run while I'm excercizing the fuzzy-beast. Both of these places are things that you most likely will not want to bring a computer, even a laptop.

      Besides... When I'm a beginner in something I don't want a book. I want online tutorials, things I can copy/paste to quickly see how they work.. THEN when I'm sure that something is worth learning I'll buy the book, and it will sit on my shelf until I'm comfortable with the concepts and know what I'm looking for.

      Linux, for example. If I knew that I wanted to do a "backup", chances are "backup" wouldn't be in the index and I'd have to putz around looking for something that would suit the bill. Online I can do a search for "Linux backup" and get an idea of what I need to know. From there I'd probably start researching cpio, afio, tar, backup media, incremental backups, etc.

      I think books are positively worthless to the beginner. They only begin to become useful when the beginner becomes 'intermediate' or progresses to the point where they know enough about the subject to know what they're looking for in the index.

      -Sara

    9. Re:don't need a book by php_freak_eternal · · Score: 1

      I honestly tend to think otherwise. I have used the information from WROX PHP books to full effect in real world.I even tried the Hugh and Lane book,the peter black book and found them shitty.The best combination i found was the Professional PHP4 from WROX and the Essential Func Ref from New Riders.

  2. The book by HFXPro · · Score: 0, Troll

    Glad to see another book on PHP and MySQL usage. Maybe now I can make some site that kicks the blank out of my friends who has all have caught the .Net virus.

    --
    Reserved Word.
    1. Re:The book by HFXPro · · Score: 1

      Oh my god I used "has" rather then "have" on that last sentance. Also lots of bad grammer in that post. *Sarcasticly says to self* >> Perhaps its time I take another English literature that my university forces me to take. All that English literature really helps me to learn proper programming techniques.

      Oh shit I'm talking to myself again.
      --
      Reserved Word.
    2. Re:The book by geekopus · · Score: 1

      I have to admit that I sympathize with this sentiment.

      So many of my friends seem to think it's inevitable that .NET will be the only web platform out there.

      It's really depressing. Microsoft won the public opinion war a long time ago (a clear sign comes when you ask an average user what kind of computer they have and they answer Office 98), and now they seem to be swaying developers as well.

  3. LAMP systems by NewbieSpaz · · Score: 1

    LAMP systems (Linux, Apache, MySQL, PHP, for the newbies...) work really well and are easy to implement, especially if you know a little C,C++ and basic HTML. Looks like I might have to buy this book, any reference on this helps me...

    --
    ------
    Random, useless fact: I type in startx entirely with my left hand.
    1. 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.

    2. Re:LAMP systems by vectorswept · · Score: 1

      It probably is more popular than linux wonks would like to admit, but it is in fact less popular than windows people grok. I think you point right to the heart of the issue, it is platform agnostic which makes it valuable software.

    3. Re:LAMP systems by jjsjeff · · Score: 1

      If I may throw my $0.02 into the mix...

      Linux Magazine has a "LAMP Post" section in their magazine. It is usually well written and older months are available here.

      Moreover, I read Linux Magazine cover to cover (multiple times usually) faithfully every month. There is information in there for everyone.

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

    2. Re:I've said it before by jrmann1999 · · Score: 1

      Nevermind those pesky "algorithm design and analysis" topics. Or the theories on how languages are derived(basically making you able to pickup any language in a few hours).

      Don't get me wrong, I love just diving in and getting into coding. When I was pre-college I did that daily. Then when I actually learned how to plan what I was doing my code was 100x better. The only thing that diving in gets you is horrible style and structure.

    3. Re:I've said it before by kzinti · · Score: 1

      Learning how to design software, and learning how to implement a design by programming in a language are two different (but related) things. Software design skills tend to apply across broad swaths of languages, though of course design skills change depending on the language: designing for an object-oriented language is and should be different than designing for a non-OO language. (Though an OO language can be reduced to a non-OO language if you don't use it well; who was it that said "A good programmer can write FORTRAN in any language"?)

      "Diving in" doesn't necessarily lead to horrible style and structure. A good disciplined programmer can dive into a new language and find ways to transfer his good coding skills to programming well in the new language. Good style is largely orthogonal to specific languages - likewise if you're a sloppy C programmer you'll probably also be a sloppy perl, PHP, or Python programmer.

      --Jim

    4. Re:I've said it before by neafevoc · · Score: 1

      Definitely.

      First I started out with Professional PHP4 from WROX (just to give me an idea). But they don't go through all the functions, therefore I headed over to php.net. The normaly documentation for the functions didn't do too much for me, but the user contributed notes did A LOT. (I was also new to MySQL, i wish mysql.com had as much documentation.)

      And if php.net still couldn't answer my question, I finally sucked it up and asked on #php on OPN. They can be just as helpful... but normally I would get the RTFM and end up finding it again on php.net :)

    5. Re:I've said it before by Anonymous Coward · · Score: 0

      Dude, you got TOLD.

      Diving in leads to HORRIBLE SPAGHETTI CODE. You might as well learn BASIC if you're into that kind of shit.

    6. Re:I've said it before by Anonymous Coward · · Score: 0

      But you can't read it in the rest room. Now I admit to reading code while "resting", now you should.

    7. Re:I've said it before by Anonymous Coward · · Score: 0

      I agree completely. All the information anyone with a general understanding of html and some very basic programming under there belt could want and more is available on the PHP and MySQL web sites. Last summer I built a PHP/MySQL site and I never needed anything else, never even thought anything more would be any use to me. I don't see how advanced users would want it either, since it's faster and easier to search the online documentation than to look up possibly outdated information in a book.

  5. It's amazing how far this language has come by ObviousGuy · · Score: 0

    From a Perl script to a full blown niche programming language, PHP is growing like gangbusters.

    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.

    PHP really takes to heart Perl's kitchen sink mindset and puts everything that would be useful to the web developer right at his fingertips. This book looks like a worthy addition to any web dev's bookshelf, though I see it sitting on the desk wide open a lot of the time ;-)

    --
    I have been pwned because my /. password was too easy to guess.
    1. 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.

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

  6. 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
    1. Re:Amazing... by Anonymous Coward · · Score: 1, Funny

      You should've reviewed it for Slashdot.

    2. Re:Amazing... by Anonymous Coward · · Score: 0

      And he gives to all, small and great, the poor and those who have wealth, the free and those who are not free, a mark on their right hand or on their brows; So that no man might be able to do trade but he who has the mark, even the name of the beast or the number of his name.

    3. Re:Amazing... by Anonymous Coward · · Score: 0

      Note that revelations is part of the new testament, and thus not part of the Jewish faith, only Christian and (IIRC Islamic)

    4. Re:Amazing... by Anonymous Coward · · Score: 0

      Oh and don't forget:

      we don't control the media OY VEY have pity on us OY VEY support israeli terrorism and antagonism with US dollars OY VEY israel is just defending itself by invading palestinian land OY VEY!

      Shove your self-righteous yamulka up your stupid ass.

  7. linux only? by Anonymous Coward · · Score: 0
    helping people use the common Linux, Apache, MySQL and PHP combination to produce database-backed websites.

    when did apache, mysql, and php stop working on OpenBSD, FreeBSD, Solaris, etc etc?

  8. The Web is Dead by Perlguy · · Score: 0, Flamebait

    We all know that the web is dead anyway. Microsoft is going to implement a new feature in office that creates it's own globe (a.k.a.: web). Microsoft is the dominant leader in software technologies and with their position can drive consumers whichever way they want.

    Forget PHP, forget Perl, forget Python & Ruby. .Net is where the future is...

    --
    -- Windows security? Sure, which ONE would you like? -me
    1. Re:The Web is Dead by Anonymous Coward · · Score: 0

      The more you tighten your grip, Gates, the more consumers will slip through your fingers.

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

    3. Re:The Web is Dead by Ironfist_ironmined · · Score: 1

      goddammit M$, rig C|Net polls all you want but dont go trolling slashdot!

      --
      0xC3
    4. Re:The Web is Dead by Anonymous Coward · · Score: 0
      Microsoft wants to replace the World Wide Web (Tim Berners-Lee's WWW) with it's own network running under .NET. They want to use SOAP and Web Services to do it. You can read about it later at:


      But first go see how Debate foams over SOAP 1.2 in the W3C working groups for XML, SOAP and Web Services.

      It seems that Roy Fielding, one of the key architects of HTTP and a member of the W3C TAG (Technical Architecture Group), which essentially defines the principles of Web architecture inside the W3C, pointed out that the SOAP specification broke universally-accepted WWW protocols and would be unlikely to succeed. At the same time Fielding and others have pointed out that Web Services can easily be implemented today including all desired security and authentication by using current WWW protocols and by judicious use of what he calls a REST Architecture, a subset of the current WWW architecture.

      Microsoft's plan is unlikely to work: the members of the involved working groups have realized that failure of SOAP to be consistent with WWW will doom it to failure because of the additional complexity and lack of scalability that would entail.

      See also

      • Paul Prescod's Home Page and especially the section "HTTP and REST" wherein he elucidates the subtleties of REST and how SOAP breaks the WWW. Prescod is one of the most vociferous and well-written supporters of the REST architectural style in the W3C working groups.
      • A REST Tutorial for Roger Costello's brief but excellent introduction to Roy Fielding's REST and why it will be the basis for any viable Web Services architecture.
      • Visit the REST Wiki to relax in an oasis of ideas that explains how Web Services can be implemented today in a manner
        • not as complex as the proprietary vendors and current and pending specifications of SOAP appear to require,
        • using the technology and tools you already know.

      Finally, dive into the waters of the oasis and wash the SOAP off of your soul. Now pure of heart, make a pilgrimage to Tim Berners-Lee's Design Issues for the World Wide Web where you can

      • re-examine the issues of the WWW,
      • renew your commitment to doing things "the right way",
      • revive your passion for excellence and
      • remind yourself that indeed, sometimes "less is more."
    5. 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!

  9. Using PHP and MySQL for a website... by Starship+Trooper · · Score: 0, Troll

    ...that's kinda like using a water pistol in a gunfight, don't you think?

    --
    Loneliness is a power that we possess to give or take away forever
    1. 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.

    2. Re:Using PHP and MySQL for a website... by krammit · · Score: 1

      I don't think that at all.

      --
      "Watch your cornhole, bud."
    3. 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?

    4. Re:Using PHP and MySQL for a website... by Galaxie · · Score: 1

      You either don't know php, don't know enough to be effective, or are one of those people who requests that they need 3 webservers and 3 database servers just to put an average of 20 to 30k of information on a webpage per hit.

      Just for reference: http://apachetoday.com/story/2002-06-04-001-06-PR- DT-PH.html

      php is being used by thousands of large corporations to run some very vital data, usually off of PostgreSQL, mySQL, or in some cases Oracle.

      damn man.. that was a stupid post..

      --
      <end/>
    5. Re:Using PHP and MySQL for a website... by Starship+Trooper · · Score: 1
      Slashdot uses MySQL.
      And that's supposed to impress me? The traffic Slashdot gets is insignificant compared to top-tier sites like eBay, Amazon, CNN or even microsoft.com. Even under Slashdot's rather minor load, the site goes down with alarming frequency, despite hosting MySQL on a quad-Xeon machine! Oracle on a box half the size of their MySQL server handles roughly the same amount of load without needing to have scheduled downtime every night at midnight (to cope with MySQL and mod_perl's Swiss-cheese memory management). MySQL is a toy database (no transactions? no subselects? no row-level locking?!), and Slashdot is a toy website in comparison to sites running real web applications. MySQL isn't even a consideration for serious business.
      --
      Loneliness is a power that we possess to give or take away forever
    6. Re:Using PHP and MySQL for a website... by Anonymous Coward · · Score: 0


      Yeah, designing a low volume website is all well and good...

      ... until someone posts a link to slashdot that is.

    7. Re:Using PHP and MySQL for a website... by Anonymous Coward · · Score: 0

      MySQL has transactions and row-level locking when you use InnoDB under MySQL (which I believe Slashdot does now). Sub-selects are supposed to be in 4.1 I believe.

      As for bigger name "serious business" sites, Yahoo! Finance uses MySQL.

    8. Re:Using PHP and MySQL for a website... by Starship+Trooper · · Score: 1
      You either don't know php, don't know enough to be effective, or are one of those people who requests that they need 3 webservers and 3 database servers just to put an average of 20 to 30k of information on a webpage per hit.

      No. Quite the opposite, really. No matter how "effectively" one codes PHP, there's no getting around the facts that the language is slow, the syntax disgusting (using C-style string manipulation in an interpreted language is just STUPID), and that ASP-style mixed HTML and scripting languages encourage slovenly, disgusting coding practices. While mod_perl is bad enough, if Slashdot were coded in PHP it would need about twice as much hardware to handle the equivalent load, in order to cope with PHP's terminally laggard interpreter.

      php is being used by thousands of large corporations to run some very vital data, usually off of PostgreSQL, mySQL, or in some cases Oracle.
      Replace "large corporations" with "fly-by-night dot-bomb VC leeches who can't afford a competent Java servlet programmer" and you'll be closer to the truth. All of the most frequented sites on the net either use Java servlets or ISAPI modules, because those are the only systems fast enough to handle load on the level of eBay or Yahoo. By replacing my company's rusted old PHP-based site with a fast, efficient Java servlet, we were able to repurpose half of the boxes in our load balancer, and the site still manages to handle at least 30% more load than the old PHP server. PHP wastes hardware and money; it's neither scalable nor maintainable.
      --
      Loneliness is a power that we possess to give or take away forever
    9. 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
    10. Re:Using PHP and MySQL for a website... by Anonymous Coward · · Score: 0

      Puh-lease:
      Size of database: 25 GB
      Average number of concurrent connections: 60
      Max number of concurrent connections: 250

      That is seriously WEAK.

    11. Re:Using PHP and MySQL for a website... by Anonymous Coward · · Score: 0

      But isn't Yahoo a serious business?

    12. Re:Using PHP and MySQL for a website... by Anonymous Coward · · Score: 0

      the language is slow

      You are really a troll. You have no fucking clue about PHP speed. You are the kind of guy who thinks everything that is free has to be crappy. Go back to your overpriced Windows 2000 + Oracle + J2EE server and stop trolling.

    13. Re:Using PHP and MySQL for a website... by Anonymous Coward · · Score: 0

      True, it is. But remember before they said they were using a mixture of flat-files and BerklyDB. So even 'serious' businesses make poor decisions. A lot of 'serious' businesses use Oracle when not necessary (usually because they have a site license and it's 'there') for smallish intra-net type things. Could MySQL work there? Sure. I don't measure products by *who* or *how many* use them (think Microsoft, Oracle, etc.) -- I measure products by their technical merit and TCO.

    14. 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
    15. 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
    16. Re:Using PHP and MySQL for a website... by Anonymous Coward · · Score: 0

      First, these benchmarks are 'toy' benchmarks. To fully compare Resin to other servlet engines or Perl or PHP, you need to write your full application in both languages and compare the two. These benchmarks are only a starting point and should be taken with a grain of skepticism.
    17. Re:Using PHP and MySQL for a website... by Anonymous Coward · · Score: 0
      If you want to listen to caucho.com, then do so:
      First, these benchmarks are 'toy' benchmarks. To fully compare Resin to other servlet engines or Perl or PHP, you need to write your full application in both languages and compare the two. These benchmarks are only a starting point and should be taken with a grain of skepticism.
      ...
      So is Resin or PHP or Perl faster? It really depends on your application. As a first cut, it's probably best to assume they have about the same performance unless you can benchmark your specific application. A difference of only 30% in a toy benchmark should be interpreted as having little or no difference.

      So... essentially, these benchmarks don't mean much other than for what was tested here. In addition, there are things you can do to speed up PHP quite a bit, and some are free like PHP Accelerator. It works by caching compiled scripts so they don't need to be for each page view.
    18. Re:Using PHP and MySQL for a website... by Anomolous+Cow+Herd · · Score: 1

      Don't forget a complete lack of stored procedures and triggers. Last I heard about it, they said they'll implement them "sometime" using Perl (!).

      --

      "I don't know that atheists should be considered citizens, nor should they be considered patriots." - George Bush
    19. Re:Using PHP and MySQL for a website... by Anonymous Coward · · Score: 0

      there are only two sites that handle the load level of eBay or Yahoo. Three guesses what they are.

      And neither one uses Java or IIS.

    20. Re:Using PHP and MySQL for a website... by Anonymous Coward · · Score: 0

      According to CmdrTaco, the vast majority of Slashdot visitors never even look at a dynamic page. Plus, I've heard that slashcode has it's own handrolled data caching layer written in Perl. Sounds like over-complicated design to work around rdbms limitations to me.

    21. Re:Using PHP and MySQL for a website... by Verizon+Guy · · Score: 1

      You pro-Free Software people can be so brainwashed that you are retarded.

      eBay runs IIS. Hear that? eBay RUNS IIS!

      The site cgi.ebay.com is running Microsoft-IIS/4.0 on NT4/Windows 98.

      Grow some pubes, please.

      --

      Aw, fuck it. Let's go bowling. - The Big Lebowski

  10. Here's a review... by digerata · · Score: 0, Troll
    Don't use PHP.

    Use mod_perl.

    --

    1;
    1. Re:Here's a review... by grokBoy · · Score: 1
      I don't think that was a troll, to be honest. I'd rather write a decent perl script any day.

      PHP worries me in its complexity - with that many compile-time options to choose from there are bound to be many more security holes around the corner in some of the more obscure code.

      That's not to say I disapprove of PHP, I just wouldn't use it myself.

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

    1. Re:I really wish... by axxackall · · Score: 1
      there was better PostgreSQL support out there...

      I just wish there was more Open Source stuff out there for Java related stuff...

      Try Cocoon (if you love functional programming on XSL) or Struts (if you are poisoned by EJB) from Apache. Both work nice with PostgreSQL.

      Or better try Zope and Python if you love OOP and hate Java-monster at the same time.

      --

      Less is more !
    2. Re:I really wish... by StevePark · · Score: 1

      Well, if it's open-source Java/J2EE tools you're after, there's JBoss, Jetty, Tomcat, Struts, Ant, Resin and a soon-to-be-released open-source JDK from the Apache group. Personally, I love JBoss. It's very powerful, easy to use and is completely cross-platform (i.e. no native code).

    3. Re:I really wish... by Anonymous Coward · · Score: 0
      JBoss? give me a break. I downloaded JBoss current 3.0 with current Tomcat 4.0.3 and tried to deploy several WAR servlets, including Cocoon and few mine - all worked perfectly with standalone Tomcat (same 4.0.3). No one worked with Tomcat under JBoss. JBoss completely changed the deployment scenario after Tomcat. And there is nothing in forums, newsgroups and just on the web. It seems like all secrets are hidden in docs and here is the trick - the docs are not free! Therefore JBoss is also not free.

      Personally I stay with Tomcat and Cocoon. But now I understand better why most of web-developers love PHP with MySQL - it's easier to make first steps and to build the prototype of an application. But if the prototype works - why to bother and rewrite it to Java? They stick with PHP.

      In order to save lost souls of those PHP developers JBoss needs much better deployment - at least as simple as Tomcat has got. And at least with same quality of distributed examples.

      By the way, look at JBoss web site. What kind of useful info can you find there? Mostly photoimages of happy developers loughing at your face that you are so naive.

  12. Another O'Reilly Book by baldass_newbie · · Score: 1, Funny

    O'Reilly is like the Pepperidge Farm of computer books.
    "If it's an O'Reilly, it's got to be good."

    --
    The opposite of progress is congress
    1. Re:Another O'Reilly Book by $rtbl_this · · Score: 1

      "If it's an O'Reilly, it's got to be good."

      Sadly their Apache and MySQL (at least the first edition - I haven't seen the new one) books undermine this. I used to buy ORA books sight-unseen, comfortable in the knowledge that they'd be good. These days I've learned to check them out first and compare them to any Wrox or New Riders books on the same subject.

      --
      "Are you being weird, or sarcastic?" said Emma. I said I didn't know because I get the two feelings mixed up.
  13. 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

  14. I've read this one too.... by Grape+Smuggler · · Score: 1, Interesting

    I've been entrenched with JSP heavily for the last couple of years, so I haven't familiarised myself with PHP yet. I needed a book that would show me a larger picture than I got in a web developer's job, and showed me how to put it together with more modern techniques.
    This book is a perfect example of why I choose O'Reilly whenever in doubt. Chapter 1 is an overview of how web applications are put together. Chapter 2 goes through all the basic PHP syntax (stuff that would take other books several fluffy dry chapters to process). Chapter 3 gets you through all the mySQL and sql basics so you feel comfortable with that, too.
    There's no 4 page tutotial entitled: "Using a text editor: Wordpad" There's also no kitch "Employee Database" example cop-out. Instead, Hugh and Dave give a realistic and usable storefront application. This book alone is probably enough for the independent web developer to get a functional site up for her/himself or a client.

  15. I appreciate your pedantry by ObviousGuy · · Score: 1

    But this history of PHP says that I'm right.

    --
    I have been pwned because my /. password was too easy to guess.
    1. Re:I appreciate your pedantry by LetterJ · · Score: 1

      Then we may have a Bob Dylan-esque "shifting background" kind of thing going on. I based my comment off of a speech I heard Rasmus give. His "history of" focused on building the C programs at work for others to use.

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

    3. Re:I appreciate your pedantry by Anonymous Coward · · Score: 0

      Blessed are the peacemakers, for they shall be called the sons of God.

  16. Well by sheepab · · Score: 1

    You dont really need a book, but I bought one back when I first started php/mysql it was really helpful. Link Here.

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

  17. It must a requisite by theManInTheYellowHat · · Score: 1

    Since there was a review about CGI and Perl there must me some PHP review today to be fair.

    You all are all wet use sh for all your web CGI / programing / culinary needs. It parses, dices, and slices.

  18. Web Application Database security links by Anonymous Coward · · Score: 1, Informative
  19. 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 wbav · · Score: 1

      I never ment to understate how important it is to also try what you learn, but with relation to this article, a book is always a version behind, and never quite right. Where as the user contibutions on the php site can give you real insight to how the code works and how you might use it.

      --

      =================
      Unix is very user friendly, it's just picky about who its friends are.
    2. Re:Real Programmers Learn By Doing by kzinti · · Score: 1

      My comment wasn't meant as a criticism - in fact what you said about the website doco was right on the mark. I learned PHP myself by downloading the HTML manual and reading it while I played with the language.

      But whenever I see someone say something like "The best way to learn programming language Z is to..." it kind of sets me off. Of all the programmers I've known, the best ones always want to get their hands on the compiler first thing when learning a new language. And that's my personal experience too: it's all find and dandy to read something in a book, but deep learning, the kind that sinks in and stays, doesn't begin until I actually use the language.

      --Jim

    3. 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/
    4. 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.

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

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

    7. Re:Real Programmers Learn By Doing by kzinti · · Score: 1

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

      I never said hands-on would replace books or even training classes. In fact, I believe I said several times that the hands-on needed to be accompanied by reference or tutorial material. But I don't think that books and training are the critical factors in learning a new language; I think real hands-on experience is.

      Furthermore, I absolutely do not equate experimenting with a language to "trial-and-error". Just the opposite: in playing around with a language, once you know the basic control structures and syntax, I expect you to learn the language's strengths and weaknesses: how good is its object model (say), or its data structures, its exceptions, etc., etc. I expect you to test it, to put it through its paces. True, you can read about these things in the language reference, but until you actually put them into play, you don't get that deep visceral feel for how well they actually work in practice. In particular, I like to take difficult problems that I encountered in the past in other languages, and see how well the new language is set up to deal with the same problem: does it deal with it better, or worse? What are the tradeoffs? Clearly now we're way past "hello world", but as I said: you want to implement some nontrivial program of your own design.

      Nor do reject the idea of learning from reading, be it "best practices" or "don't do this". That kind of material definitely has its place in the equation, but I don't think it becomes effective until you're reasonably fluent in a language, and especially until you've had the chance to transfer your own skills from other languages. I think you have to draw on all that you have available, but I don't think any of it is really effective unless you absorb it with a keyboard at your fingertips.

      Finally, on the subject of becoming more than a good programmer, I'll say this: software is like painting: anybody can learn to slap paint onto a surface well enough to paint a barn. It's an essential skill, but if you want to move above painting barns and learn to paint something like the Mona Lisa, then you need to learn a whole additional set of skills. Good programming is relavitely easy; good software design is hard.

      --Jim

    8. Re:Real Programmers Learn By Doing by mooman · · Score: 1

      ColdFusion (at least until you get the new MX version) still parses the page each time it's loaded, and has to scan through all your comments to make sure they get weeded out. It all adds time, nearly trivial time, but time nonetheless that is a non-factor for a compiled language where that all gets stripped out during the compile stage...

      --
      In the Portland, Ore area and like card games? Check out: http://groups.yahoo.com/group/portlandgames/
    9. Re:Real Programmers Learn By Doing by mooman · · Score: 1

      Just because I have a web page that I haven't updated in 5 years doesn't mean I don't know programming. I've just been too busy to work on it.

      It's an ironic comment coming from someone whose own webpage says "don't bitch about the web design. This is a quick hacked-together page...".

      Oh well. I guess neither of us will hire each other....

      --
      In the Portland, Ore area and like card games? Check out: http://groups.yahoo.com/group/portlandgames/
    10. Re:Real Programmers Learn By Doing by SpamJunkie · · Score: 1

      I won't pretend to know the best way to learn a new language but one of the better ideas to be more than mearly good is to read code. Find an open source project written in your language and read it. That's one of the best sources of wow! factor ideas.

      The only problem I've had with this method is picking a good example project. All too often stuff on sourceforge is made by people that don't know their language that expertly or that don't write very nice code. Popularity certainly isn't the best way to pick an example project.

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

    12. 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 :)

    13. Re:Real Programmers Learn By Doing by Carpathius · · Score: 1

      I don't completely agree. I think the best programmers understand language paradigms -- OO, procedural, etc, and once those paradigms are understood, then all that's left is syntax.

      You shouldn't write Java the same way you write C, shouldn't write C the same way you write Perl, but if you understand "best practices" in any OO language, you understand most of what you need to know about another OO language.

      Except, of course, syntax.

      A good programmer is going to understand the different styles required by different languages, is going to be able to understand which style is needed simply by the language definition, and is going to need to learn little more than syntax and what built in classes/functions are available.

      For me? I'll hire the programmer that *wants* to jump in. He or she will probably need some kind of reference, but I'd much rather have the person who starts coding immediately than the one who insists that s/he needs to be trained in the language.

    14. Re:Real Programmers Learn By Doing by kzinti · · Score: 1

      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.

      That's called Trial By Fire. It's taught at the School of Hard Knocks. In a couple of years, you'll look back on this and laugh... as the attendant wheels you out of your padded cell for your daily session with the Software Recovery group. Enjoy!

      --Jim

    15. Re:Real Programmers Learn By Doing by Anonymous Coward · · Score: 0

      Even Javascript is now compiled and cached by browsers, so the pre-compiled version is used upon reloads.

      Which makes for great fun when you're trying to debug a script. It didn't dawn on me until about my 4th refresh that Internet Exploder wasn't reloading the script. I eventually had to clear the cache and quit and restart IE for changes to take effect. Sheesh!

    16. 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.
    17. Re:Real Programmers Learn By Doing by Anonymous Coward · · Score: 0

      Browse locally and it will have an accurate timestamp so it will know it's cache is out of date. IE does get confused with jabbascript on the web and it ignores timestamps.

    18. Re:Real Programmers Learn By Doing by gutier · · Score: 1


      I'm glad that the rest of the engineering world has advanced beyond the trial-and-error approach.

      The mechanics of any technical trade are the absolute easiest to pick up. The "why" is a little harder and is the reason people have to learn professional designations before working on something substantial.

    19. Re:Real Programmers Learn By Doing by Anonymous Coward · · Score: 0

      You are not really correct here either. I remember studied chess a lot and would play the occasional game against one guy who had better tactics than I did. His theory was bad compared to mine and he would do things like bring his queen out too eary and try do attack with 2 or 3 peices while I would routinety stop the attack and develop my pieces. I always seemed to be ahead in the end game but I was 3 wins 2 loses and a draw which is dismal when being ahead after the queeens are off the board. The problem was I did not do it enough and I did dumb mistakes that cost me games. Now when I got chess computer all that changed and the combination of thoery and practise made me a good player.

      I think theory and practise are equally important. The trainly manuals will not get you acustomed to putting things together for a creative solution. You have to be used to being in the kitchen when you run out of an ingrediant. Once I ran out of corn starch. I remebered rice flour in a recipe once and noticed it acted like corn starch. I did not have rice flour but I had rice and a coffee grinder....(only experience could do that).I have run into code where a nice clean cooked peice of code just was not there and for that theory only person you will merely be good as well. You need lots of both.

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

    21. Re:Real Programmers Learn By Doing by Issue9mm · · Score: 1

      Agreed. If every language had the type of documentation found at php.net, programming wouldn't be nearly as daunting a task as people make it out to be.

      As for my experience, the PHP manual taught me all the perl I know, in an indirect method.

      (Note, I am by no means a great perl programmer, but I've not been able to accomplish any task thus far.)

      -9mm-

  20. 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 Shadarr · · Score: 1

      I second that. When I was first learning MySQL I printed out the whole manual, which took up two binders. And then I mostly used the web version anyway because it's searchable. With PHP I never even bothered with paper because the website was so good. Not just the actual manual, but the comments people leave about the manual entries. Source code snippets, reasoning about why to use different methods, it's all right there and free. The only book I have is the O'Reilley Pocket Reference in case my network connection is down.

    2. 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
  21. Why Not Java? by cbernard · · Score: 1

    If you are designing a new web app, why would you not use Java? The language not difficult to use, and the platform is objectively better architected that PHP.

    1. Re:Why Not Java? by Clay+Mitchell · · Score: 1

      Because it's not open source.

      Seriously though, that's a very valid question. Aside from the fact that it's not GPL'd, it has a) better development tools, b) more libraries out there for the picking, c) better real live commercial support and d) you can use it for free.

      I personally ditched PHP several months ago and aimed squarely at Java. God knows it looks better on a resume...

    2. Re:Why Not Java? by digerata · · Score: 1
      Also, servlets, which are IMHO much better than JSP or PHP, can be used. Servlets more closely mimick the CGI paradigm the same way Perl does.

      JSP and PHP are horrible for any type of application that has more than 1 developer and more than one revision of HTML layout. The integration of program logic with output display is the wrong way to do any type of large Web Application.

      The creative staff that are responsible for designing the 'look n feel' of the application must coordinate closely with the developers. Each time the creative staff wants to revise something, or try out a new look, they must force the developer to reintegrate the display and logic.

      And don't even think about incorporating multiple types of application styles based on who is logged in. Sure you could do it. But try and maintain it in a timely fashion!

      The only real world solution to a large web application today is either J2EE or mod_perl.

      --

      1;
    3. Re:Why Not Java? by Clay+Mitchell · · Score: 1

      That's why you want to stick with the Model-View-Controller paradigm.

      You've got your data model and the classes that work in behind it, enforcing business rules and the like, then you have your controller servlet which says "ok, they want this, they need this page" and then you use your jsp's that just display information.

      You take the processing away from the JSP and put it in the servlets/classes where it's faster and it's not such a huge pain for the designers to whack at it because it's just the occasinal <%=foo%> as opposed to a bunch of full fledged java code.

    4. 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.
    5. Re:Why Not Java? by daf00masta · · Score: 1

      <i>If you are designing a new web app, why would you not use Java?</i>
      <br>
      hm...why WOULD you want to use Java? Java is way to resource hungry, not Open Source, and though i think you mean JSP instead of Java, PHP is still easier to use, and it won't eat up your memory and use up mad amounts of CPU time.....
      LAMP/LAPP/WAMP seems like one of the best options avaiable, anything other than JAva :D

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

    7. Re:Why Not Java? by Anonymous Coward · · Score: 0

      Apple's WebObjects is totally Java, and it's a very good web developement system.

      It may be more resource intensive, but who cares? It's damn easy to set up -very- robust systems that can scale across multiple machines.

    8. Re:Why Not Java? by natbudin · · Score: 1

      hmm... not to troll here, but you could say the same thing about Zope. I haven't yet found an easier language to use than Python, and Zope seems well-organized. And yes, there's a speed/memory overhead in comparison to PHP, but you'd get that with Java too. Plus, Zope is open source :)

    9. Re:Why Not Java? by Nept · · Score: 1

      I agree regarding JSP - but the solution is to not put any logic in your JSP. For those who haven't used JSP, the problem is that the JWS has to compile the JSP page into a servlet prior to interpreting it, which of course makes it awfully slow. I think one of the best practices architecture is to do all of your business logic and database calls from a servlet/databean and then have the result set encapsulated inside of a javabean and returned through the session to the JSP page. The JSP page only is responsible for retrieving the JavaBean object from session memory and displaying the values. No heavy processing here.

      When you say JSP+EJB, I couldn't agree with you more. Doing a JNDI call from a JSP page is suicidal, but I wouldn't reject webapps for this reason - just build a better architecture :)

      I would recommend looking at the Java Pet Store Example from Sun's site. It's their official Enterprise Blueprint for Java Webapps and might help to convince you otherwise.

      Personally, for using EJBs, I've found the most efficient implementation is to use (1) using some clever caching design patterns for the lookups (2) cloning design patterns to prevent all method calls from being remote calls and (3) to have the EJBs called from a servlet or other class file.
      At any rate, Java technnology has its uses in the Enterprise. I've used PostNuke, PHPNuke and done some PHP coding on my own, but I wouldn't consider myself an expert, but I suspect it may not scale quite as well in a large application as a properly designed Java Webapp might.

      --
      "Teachers leave us kids alone ..." - Roger Waters, Pink Floyd
    10. Re:Why Not Java? by gripdamage · · Score: 1

      I agree regarding JSP - but the solution is to not put any logic in your JSP.

      Exactly.

      In another thread someone was complaining about PHP not switching database backends well. The problem was not PHP, but their coding practices. They were making raw sql calls in their pages instead of going through a database wrapper.

      Similarly people embed their program logic in a JSP page, which is exactly what you aren't supposed to do, and then complain that it's slow and hard to debug.

      JSP can be used like ASP (yech!), but isn't supposed to be. The whole beauty of JSP pages is that you can seperate the program logic from the page, which makes redesigning the look of pages a snap.

      I find this approach works very well for any webapp, big or small.

      Speaking of how easy it makes redesigning the web pages, in my current webapp I let people upload page templates and an interpreter fills in appropriate code (replacing simple keywords in the template).

    11. Re:Why Not Java? by Anonymous Coward · · Score: 0

      Anybody that uses "...needs to be shot..." needs to be shot.

    12. Re:Why Not Java? by Anonymous Coward · · Score: 0

      will i be able to see it from my lynx or my wap mobile?

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

  22. Better yet (if you use Mozilla) by Anonymous Coward · · Score: 0

    Create a PHP Bookmark with a location of http://www.php.net/manual-lookup.php?function=%s and then create a keyword (ie phpman). Then in your address bar, you can just type phpman "whatever you wish to search for"

    It's excellent. I use it all the time.

    1. Re:Better yet (if you use Mozilla) by Anonymous Coward · · Score: 0

      Or php.net/WHATEVER even!

  23. ahem by Pinball+Wizard · · Score: 1, Troll
    you PHP weenies(kidding) can't hog the 'P' part of the LAMP acronym all to yourselves.


    The 'P' in LAMP refers to Perl/PHP/Python.

    --

    No, Thursday's out. How about never - is never good for you?

    1. Re:ahem by BdosError · · Score: 1

      So, maybe the 'P' in LAMP stands for "scriPting"? Or maybe "pScripting", with a silent 'P' ("... as in 'pool' " - Benny Hill).

      --
      Complexity is Easy. Simplicity is Hard.
  24. Re:PHP == Perl for girls by mrkitty · · Score: 0

    Agreed php coders tend to have more exploitable holes then perl coders. Perl coders learn from their mistakes at least.

    --
    Believe me, if I started murdering people, there would be none of you left.
  25. 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--
    1. Re:But MySQL doesn't do UTF-8... by Anonymous Coward · · Score: 0

      I'll call you out.

      What do you think you need UTF-8 for?

    2. Re:But MySQL doesn't do UTF-8... by andersen · · Score: 1

      I need it because large chunks of the content I intend to store in the database and need to be able to search through are encoded in UTF8. So I can either pre-process all that content (many many gigabytes of UTF8 crap per database) using iconv() to convert it all into multi-byte, or use a database that can natively store UTF8.... The latter looks much more attractive to me.

      --
      -Erik -- --This message was written using 73% post-consumer electrons--
  26. 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.
    1. Re:aminamals by Anonymous Coward · · Score: 1, Informative

      platypus

  27. YAAMPB! by MattRog · · Score: 1

    Lord, just what the world needs. *Yet Another Apache, MySQL, and PHP Book*. Anyone else thing eleventy-billion of these things is around (eleventy-billion - 2) too many?

    --

    Thanks,
    --
    Matt
    1. Re:YAAMPB! by McSnickered · · Score: 1

      Actually, just 2.5 years ago there were only 2 or 3 books on the subject .... and they SUCKED! I bought one, I know. So I'm pleased to see lots of GOOD books coming out on the subject!

      --
      They call me the working man. I guess that's what I am.
  28. wow by Anonymous Coward · · Score: 0

    another book on my must read list. next time have a review on the windows registry. No, really. this is "News for NerdS"? Who can't figure this out on there own.

    1. Re:wow by Anonymous Coward · · Score: 0

      Probably the same people who can't get their/there/they're correct, much less hit shift-/ for the question mark....

  29. Only reference you need for PHP by Zach978 · · Score: 1

    Is right here.

    --

    "I told you a million times not to exaggerate!"
  30. 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.

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

  32. 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 AC-3 · · Score: 1

      Someone needs to introduce you to the concept of database abstraction in PHP. Code your classes to the DB class generic calls and then when you need to switch DBs you just swap out the db class with the (Oracle|Postgres|MySQL|Whatever) class and you're good2go.

    3. Re:I *hate* DB programming in PHP! by Anonymous Coward · · Score: 1, Informative
      Take a look at PEAR's DB abstraction layer:
      1. PEAR
    4. 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?
    5. 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
    6. 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.

    7. Re:I *hate* DB programming in PHP! by reddog1 · · Score: 1

      Not so true. There are PHP libraries out there that exist to serve this purpose. Include the library, tell it which dB you are using and all the rest of the code is the same. Check out ADODB. To see it in action, check out PostNuke. I find it rather nice :-)

    8. Re:I *hate* DB programming in PHP! by truefluke · · Score: 1

      The DBI isn't included in standard Perl. You have to download it from CPAN. Unless you've installed (or someone has for you) Indigo or NuSphere.

      --
      spam, spam, spam, spam, e-mail, news and spam.
    9. Re:I *hate* DB programming in PHP! by Anonymous Coward · · Score: 0
      In my opinion, PHP just isn't worth the hassle if you're going to be doing a lot of database work.

      If you are going to create more than a "hello-world" prototype then don't use neither PHP or MySQL. Both are too limited in functionality and too primitive in semantic.

      PostgreSQL is a right DBMS choice for a serious web-project. You'll get ACID, reliable transactions, good support of SQL standards and very flexible extensibility. I wish only it would finally have good replication, which it will soon.

      Zope is a right server-scripting choice for a serious web-project. You'll get very good DB layer, real OOP, presentation-logic split, high level of extensibility, small emory footprint and still good enough performance. I wish only it would have better integration with 4Suite or Redland RDF/XML libraries, which you can integrate (with some success) by yourself.

      I guess PHP and MySQl are more popular only because of lack of programming skills of most of so-called web-developers. However, no book, including the referenced one, is able to help to develop such skills. I would compare PHP with Visual Basic, while MySQL with MS Access. Too primitive and very limited.

    10. Re:I *hate* DB programming in PHP! by SpamJunkie · · Score: 1

      Perl's DBI is very nice.

      But I have to mention Python's DB API2. It works very well also. Moving between compliant DBs is quite easy - I've moved from MySQL to Postgres twice now with very little effort.

      All I need now is a good mod_python, or the like.

    11. Re:I *hate* DB programming in PHP! by Anonymous Coward · · Score: 0

      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.

    12. 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 */
    13. 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.

    14. 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?
    15. 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.

    16. Re:I *hate* DB programming in PHP! by super-flex-o-matic · · Score: 0

      yeah but with php you have a way to programm object-oriented ( know -> with classes etc. ) that make changing little things like the queries a snap, if you _planned_ and _structured_ your backend. but your company got to pay you for that not me.

    17. Re:I *hate* DB programming in PHP! by Anonymous Coward · · Score: 0

      Ever tried the metabase database abstraction classes?

      http://promoxy.mirrors.phpclasses.org/browse.htm l/ package/20.html
      http://freshmeat.net/projects/met abase/?topic_id=6 8

    18. Re:I *hate* DB programming in PHP! by Anonymous Coward · · Score: 0

      >MySQL uses a column type of 'auto_increment' and requires you to explicitly insert NULL.

      What the hell are you talking about? It does not.

    19. Re:I *hate* DB programming in PHP! by Anonymous Coward · · Score: 0

      You wouldn't try to have us believe that you'd prefer ASP over PHP?????

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

    21. Re:I *hate* DB programming in PHP! by mborland · · Score: 1

      To start out with, I appreciate the comments.

      By un-portable, I meant somewhat inelegantly that you can't port your code to different databases without serious rework because there's no database abstraction. Definitely, you're right that it runs on more platforms than ASP does (don't cry to me about ChiliSoft...it's a load of crap)!

      As for using it to do command line/desktop apps...I suppose I hardly consider it a good language, for the same reason as above (no true abstraction) and the fact that it's really just a scripting language intended for web servers. If someone told me they'd built their desktop app in PHP I'd be concerned that they were just a web hack who couldn't be bothered to learn a more appropriate language.

      Finally, yes, we agree about the smaller site use for PHP. I suppose the only reason I brought that up is that I've met with a number of zealots who try to convince me that all sites should be written in PHP--and often a sentiment on Slashdot.

    22. Re:I *hate* DB programming in PHP! by Jack9 · · Score: 1

      I've always used a generic database object in PHP. I start every document with a config.php that defines the database, the paths, etc and then assume my generic objects and function calls will work through predefined wrappers or autodetection. If something breaks, PHP debugging is a breeze =)

      # we always store the last result in the obj but
      # *can* catch it if we want and it's supported
      $result = DBobj->doQuery("SELECT * FROM FOO");

      --

      Often wrong but never in doubt.
      I am Jack9.
      Everyone knows me.
    23. Re:I *hate* DB programming in PHP! by Anonymous Coward · · Score: 0

      I can't say that I know that much about PHP, but much of the example stuff I saw on the www was "Hey, you get right down to the raw nitty gritty DB specific stuff!! Sho iz Fast!". Plus tons of other basically amatuer hacks which left a distaste for the environment.

      In the vein of the discussions above, most of learning a new language is learning best practices (something the Java guys obsess over, something the Microsoft guys and the PHP guys don't seem to consider much).

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

    25. Re:I *hate* DB programming in PHP! by Anonymous Coward · · Score: 0

      Dude, get out of your mom's basement. PHP and ASP are two peas from the same pod, and it's pointlessly dull to compare them. Neither stands up to the whole java tomato or ASP.NET

      And yeah, I'd rather use JavaScript (ASP) than PHP or VBS.

    26. 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.)
    27. 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.)

    28. 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 */
    29. Re:I *hate* DB programming in PHP! by mborland · · Score: 1
      I don't know why I'm responding to your inarticulate flame.

      First of all, my original post actually was talking about how PHP can be good for many reasons, but whatever...

      Well this is mostly a lie...ODBC and ADO are libraries.
      Oy.

      Yes, ODBC, ADO and JDBC are libraries. Libraries make it really easy to take your code and port it from database A to database B, which is actually a good and common thing. I do this frequently. Frankly, in my line of work it's a good way to move organizations off of dependencies (like porting away from SQL Server)...they make it easy to run the database in SQL Server, Sybase, Oracle, Postgres...etc. It's not actually that hard to port mid-sized apps to different databases. 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.

      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.
      Goodness. Where did you learn to communicate? Insult what you do not know? Oh, wait, this is Slashdot. I'll go tell all the people for whom I built useful, profitable sites that I was called a 'hack' and have been demoted to making bad, small sites.
      Maybe you ought to look into some of the more advanced aspects of it.
      I agree, obviously some large sites have used it, true of pretty much any technology. I will look more at PHP, although if most developers are as ire-ridden as you I doubt I'll join that community.
    30. 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.

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

  34. 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 ProfKyne · · Score: 1

      The biggest problem with all the PHP books out there is that they don't talk about software design or good coding practice.

      This is so true. I basically taught myself how to program from scratch, never having had the sense to study it when I was in college. PHP was my first language. While every PHP book has its obligatory chapter on OOP, and of course they say stuff like "always comment your code", 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. And none of the PHP books even mention phpdocumentor or phpdoc, which have been amazing (basically JavaDoc for PHP).

      (I realize OOP isn't for everyone but for a small web application [not just a guestbook] it really helps to use OO design)

      --
      "First you gotta do the truffle shuffle."
    3. 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

    4. Re:Big problem with most PHP Books by ProfKyne · · Score: 1

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

      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.

      Besides that, it sounds like you have other problems pent up inside you. You must be a failing CS freshman or something -- I never brought up the subject of software engineering problems (since I'm far from an engineer) or change-friendliness. Take it up with your professor or your advisor if you have such a bone to pick.

      --
      "First you gotta do the truffle shuffle."
    5. 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?

    6. Re:Big problem with most PHP Books by ProfKyne · · Score: 1

      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?

      That's just the thing. I never meant to suggest that my approach was the *only* way to achieve it. Only that it helped me to use objects.

      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'll go you one better than that -- I'll wholly admit to being "not very good" at procedural/relational programming. Or even object oriented programming for that matter. I'm really not a good programmer! I'm trying, and learning, but I'm not claiming to be something that I'm not.

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

      I assure you, I fit the profile. Me = not a very good programmer, just someone with a few PHP/database skills.

      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.

      That's exactly what I'm talking about though. You're pulling your own preconceived notions about what I'm saying into the conversation. All I'm saying is that it made my life easier.

      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.

      Thank you. Now that we have both understood that we're really on the same level (we agree that one should not try to make a blanket statement like "everyone should use OO", which I did not), let's leave it at that.

      --
      "First you gotta do the truffle shuffle."
  35. PostgreSQL by Anonymous Coward · · Score: 0

    I wish there were more attention paid to PostgreSQL. I have used both and find PostgreSQL to be far better. And from talking with other people who have used first MySQL and then PostgreSQL, they would rather use PostgreSQl. It's a shame that more people don't use the LAPP solution instead of LAMP. I guess when you dont really care how well it works .. just that it works, you end up using MySQL. But I have always found PostgreSQL to be easier to setup, admin, and use PHP with.

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

  37. Office 98 is a Mac. by Anonymous Coward · · Score: 0

    Lol, you got your own example wrong!
    office 95 = windows
    office 97 = windows
    office 98 = macintosh
    office 2000 = windows
    office 2001 = macintosh
    office XP = windows
    office v. x = macintosh

    1. Re:Office 98 is a Mac. by geekopus · · Score: 1

      No, my example was perfect.

      The point is that the user can't tell the distinction between Windows and Office, and they think that unified thing *is* their computer.

      I've been told that exact quote before, when what the person meant was "Office 97 and Windows 98".

      I knew I should have explained that, but I figured that everyone would understand.

  38. Chapter 6 by Anonymous Coward · · Score: 0

    Looking at the TOC I'm only interested in their solution to page reloads causing unknown exceptions. Does it deal with somebody clicking the Back button?

  39. PEAR DB abstraction by Anonymous Coward · · Score: 0

    There is the PEAR DB abstraction layer if this is important to you. I believe there are also a number of other DB abstractions out there for PHP. It's not quite to Perl's level, but it's getting better and better all the time, so it's really not fair to just ignore it.

    1. Re:PEAR DB abstraction by gimpboy · · Score: 1

      i lost ``touch'' with php so to speak about a year ago. i gave php up for perl a while ago. does the pear db now come with a conveniant way to install it, or does it come with the main php disto? one of the nifty things about cpan is how easy it is to install perl modules. cpan also represnets a unified development arena for the perl community. pear was trying to do this but i dont think it was having the same effect. that was one of the really frustrating things about php.

      which db abstraction layer should i use?

      there were quite a few to choose from at the time, and none of them were as mature as dbi.

      where should i go to find pre defined modules for php?

      there was no central location for this.

      the lack of uniformity in the php community can be very disheartening for someone like myself. this might have changed in the last year or so, but when i switched from php to perl it really lacked momentum.

      --
      -- john
    2. Re:PEAR DB abstraction by Anonymous Coward · · Score: 0

      Have a look at the screenshots for the pear installer - CPAN doesnt even come close...

    3. Re:PEAR DB abstraction by gimpboy · · Score: 1

      actually if you install the cpan perl modules it has a wonderful installer.

      for example to install the icecast perl module

      you run
      $cpan
      cpan> install Net::Icecast

      it will get the module in question and any dependencies you might have. then it will compile and install them. it has similar facilities for searching and quering package information. what more does the pear installer do?

      it's nice that php finally has such a beast. like i said things might have changed in the last year or so. a quick browse through the available packages at pear shows that they still have a long ways to go though.

      --
      -- john
  40. Re:Sorry to piss on your corn flakes... by baldass_newbie · · Score: 1

    You're right. Sorry 'bout that.
    Two week old baby. Up all night.
    Need Sleep...

    --
    The opposite of progress is congress
  41. I have 2 words for you: by Anonymous Coward · · Score: 0

    javah, j2ee

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

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

  44. 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 thenextpresident · · Score: 1

      First, my thoughts on PHP v.s. Perl:
      http://www.phpcomplete.com/devblogs.php?blo gid=4

      For me, the simple fact is that PHP and Perl can both be used in each their own areas. I find PHP better for the web as it has built in functions simply made for it. However, when I need scritping power or server side programs, I turn to Perl.

      PHP offers up a very easy to use syntax (comparing it to Perl's ability to obfuscate) and is therefore easier to learn the Perl by many (read Not everyone, but most people I know).

      I use both happily, and when faced with PHP v.s. Perl, I say "use whatever you are happier with".

      --
      Jason Lotito
    2. 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.
    3. 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
    4. Re:question - not trolling by Anonymous Coward · · Score: 0

      it's the syntax. Like it or not, C style syntax is the easiest to read, makes the most sense, prevents the most errors, etc. That's why it's the most widely used. Not the other way around.

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

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

  45. It's easy by Anonymous Coward · · Score: 1, Informative

    That's basically it. Someone who has never programmed before can get started with php really quickly and easily. First you can do a simple , then you can move into the fun conditional world of if and else. In no time, you have a little php application running. Throw in some mysql access, and voila. When you need some more advanced features, they're there for you. Lots of times I've thought "I wonder if PHP can do x..." and then I look, and indeed it can.

    Perl often seems quite scary to beginners. PHP doesn't.

    1. Re:It's easy by just4now · · Score: 1

      About two years ago I put together an Apache+PHP+MySQL+Oracle prototype. At the time, I looked at Perl but it seemed to have a steep learning curve - steep meaning that I'd have to spend a good chunk of time before I was able to write anything useful. I was able to quickly use PHP to execute dynamic SQL against both MySQL as well as Oracle.

      Cost was a factor here - the organization spent about $10.00 for the RedHat 6.x cd-rom - and I could have downloaded it if I had the time. I used a retread PC from one of our local offices.

      Having worked with Cobol, C, Fortran, Basic and then SQL and PL/Sql, I did not need more obscure stuff (like C++) but something almost any coder could pick up in a short period of time. PHP seemed to be the answer back then. PHP files don't need a special cgi-bin directory or other stuff - link Apache with PHP and your done.

      Like any language, Perl has it's place. But sometimes another tool is better for the task at hand.

  46. 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
    1. Re:Agreed. Another one I used: by ProfKyne · · Score: 1

      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.

      It's a good book to get across the important concepts in dynamic site design, but it completely sucks if you're starting from scratch with MySQL and PHP. I think there were something like twenty serious typos or publishing mistakes in the first fifty pages.

      A good book, ruined by poor publishing or editing.

      --
      "First you gotta do the truffle shuffle."
    2. Re:Agreed. Another one I used: by twilight30 · · Score: 1

      [Welling & Thomson:] A good book, ruined by poor publishing or editing.

      You summed it up better than me!

      I'll say, though, that I was in the same boat: no previous experience with PHP or MySQL. Checked the errata site. Before even buying the book in the first place, I read the user reviews on Amazon. I followed W&T's advice to look at both online references, and in total, learned a lot more than just the book's material (well, OK, I felt more comfortable when I ran into problems).

      To anyone looking at this subject area, do check out this book. It *is* good once you get past the first fifty pages.

      --
      ========================================
      Death will come, and will have your eyes
      -- Pavese
  47. I reviewed the companion to this book a while ago by truefluke · · Score: 1
    You can read my quick (5 minute) review of Programming PHPon www.signalnine.com.

    I haven't had the chance to look at this particular book yet but I appreciate this review. Good job. Perhaps I shall pick it up, or at least park my butt at Borders bookstore and give it a more thorough glance the next time I am there.

    --
    spam, spam, spam, spam, e-mail, news and spam.
  48. Is your penis small? by Ironfist_ironmined · · Score: 0, Offtopic

    Mr. Jerry Vines, Ph.D.
    Pastor/CEO
    First Baptist Church of Jacksonville,
    Florida


    Ph.D!! in what? religious hatred? lack of compassion? I think what he means is

    Jerry Vines, Pra.T.
    Wanker w/BO
    First Raptist Church of Jackoffville, Whorida.

    Yeah mod me down!

    --
    0xC3
  49. 90% OFF TOPIC - HELP ME WIN $100 by Anonymous Coward · · Score: 0

    A friend and I have a $100 bet going regarding PHP+Oracle. He claims that you cannot do regular expressions with oracle except with two crappy operators that match either an entire word or a single character. I claim that a giant database company like Oracle couldn't POSSIBLY be that stupid as to not have regex native (after all, MySQL has it). For instance, if I want to match something like, say, "MS" I don't want all the words that just contain the letters "MS". I want " MS "MS," MS." " MS/" and so on for a dozen combinations of punctuation and chars. Do I actually have to do a dozen different whole world matches or is there an easier way to do it. The bet is that I have to be able to do it within three lines.

  50. So is LAPP (Linux, Apache, PHP, PostgreSQL)! by jocknerd · · Score: 1

    This is what I'm using here at work to develop a job description and application system for the Personnel department that I work for.

    1. 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.
  51. COMMENT STOLEN FROM AMAZON DOT COM by Anonymous Coward · · Score: 0

    Straight cut and paste job aie?

    1. 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).

  52. LAMP vs. BAPP by Anonymous Coward · · Score: 0

    I'm amazed that there aren't more people that use BAPP, i.e. BSD, Apache, PostgreSQL and Python.
    BAPP is sometimes called FAPP, i.e. FreeBSD...

    Though I personally I prefer FreeBSD, Tomcat/JOnAS, PostgreSQL, Java.

  53. 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 !
  54. Regarding Work by Anonymous Coward · · Score: 0

    I will rewrite both of your pages... err for a small fee... Just have to provide the necessary tools and environment... How bout a nice ASP setup using IIS4, I hate 5 so modern it is.

    Forget all this PHP stuff.

  55. Stop the Monkeys! by ignatzMouse · · Score: 1

    Please, no more PHP/MySQL books.

    --
    No artist tolerates reality. -- Nietzsche
  56. Re:I made my website... by $0+31337 · · Score: 0

    Again, I apologize for my attempt at humor. I tried to be funny and apparently failed... failed badly. To whoever modded down my comment, thank you. I know I wouldn't have been able to look at my own face in the mirror if I had actually gotten a funny rating.

    Again, I am sorry.

  57. 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/

    1. Re:embedded perl by frankie_guasch · · Score: 1

      I agree, mod_perl + HTML::Mason is a win for developing big sites.

  58. PHP Templates by jwinter1 · · Score: 1

    If you are using PHP in the usual way, that is, to generate dynamic web sites, you need, absolutely need, to use templates. Any other way will eventually be impossible to maintain as your project increases with complexity.

    Our department uses a simplified version of PHPLib's template.inc, and I cannot count the number of man hours it has saved us. There're a million reasons to use templates, separate logic from presentation, let Web designers create templates and let Web coders create PHP code, etc., and only one reason not to: ignorance.

    --
    Anything you can do, I can do meta.
  59. "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.
    3. Re:"Gentle learning curve"? by Anonymous Coward · · Score: 0

      its about physics. Try riding a bike up a steep hill sometime.

    4. Re:"Gentle learning curve"? by ed1park · · Score: 1

      or up a mountain!

    5. Re:"Gentle learning curve"? by bethel · · Score: 1

      There is something wrong with your english. Steep means hard/difficult, gentle means easy. Why the heck did you get a rating of 3 for this comment?

  60. 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. :)

  61. japple by Thrakkerzog · · Score: 1

    japple is much easier than php (for me, at least), and has a solution which splits the scripting language from the HTML.

    check it out at japple.org

    I've been very impressed so far.

  62. 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.
  63. 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. :)

  64. I totally agree by Anonymous Coward · · Score: 0

    I've used both MySQL and Postgresql; in fact, I've built one
    site twice using each of the databases (irritating client - completely
    different story). People like MySQL because it's fast. Which
    is lovely. However, in the real world, when we do applications
    that actually have to manipulate data in ways other than selecting
    large numbers of rows at one time, the advantages of PostgreSQL
    are unquestionable.

    The complete lack of subselects alone makes MySQL unsuitable for
    even moderate load websites. Slashdot might use MySQL, but
    that doesn't exactly sell me on the product. Database side
    functions are nice too, as well as the relative convenience
    of writing server side database logic through PL extensions.

    I suspect it's because the feature set of PostgreSQL is more
    complex and difficult to understand for a new user of databases.
    The inexperienced go with mysql because it's fast and easy.
    But sometimes you get a nasty rash from fast and easy.

  65. SMARTY! (Re:PHP Templates) by Anonymous Coward · · Score: 0

    I couldn't agree more. I found phpLib to be a bit slow and awkward and found smarty. Honestly, use whatever you want, I just like their approach and it has a number of groovy features. Smarty is one of the more efficient templates I've found because it compiles your code and templates into pure php, making them really, really fast. It even has the option to cache your pages, which is super smart.

    I'm a lone gun in my operation--I have the severe misfortune of being the designer/programmer/db admin. The only thing I don't handle is the server setup, but those guys are MCSE's that insist on using Windows 2000 and IIS, so I'd gladly take that job to use a real OS. Regardless, I still use templates to make my life easier (an anyone that has to read my code!)

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

  67. MySQL is not faster than PGSQL by Anonymous Coward · · Score: 0
    When you have complicated DB schema, which is difficult to optimize using indices, and some of table are really big then in PostgreSQL there are more chances you will optimize your queries properly. At least what my experience shows - I have been working for awhile with both databases.

    I think the main reason that MySQL is more popular is that PostgreSQL team has less commercial support behind. There are just few simple books introducing PostgreSQL, mostly based on Momjian's one.

    There is not books about PostgreSQL in web development. For experts it's not a problem. But nost of web developers are novices. They don't know neither JDBC nor ODBC nor Xalan's SQL extensions. They heard that PostgreSQL is ORDBMS, but they don't know what to do with objects in DB.

  68. LZP? by Anonymous Coward · · Score: 0

    Linuz Zope PostgreSQL?

  69. we need books about PGSQL by axxackall · · Score: 1
    I would recommend the following books about PostgreSQL and web development:
    • PostgreSQL and XML (Xalan, 4Suite)
    • Java and PostgreSQL (JDBC, Struts, JBoss)
    • PostgreSQL and Zope
    • Web Warehouse with PostgreSQL
    If you have any ideas, proposals and suggestions - my email is axxackall@yahoo.com
    --

    Less is more !
  70. Why not mod_python and MySQL? by elysian1 · · Score: 1

    I've used both php and python and I must say that python code is WAY easier to maintain.

  71. 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.)
  72. 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

    1. Re:You don't need OO crap to wrap DB operations by rycamor · · Score: 1

      > oop.ismad.com

      Hehe... some fun stuff there. I especially agree with your take on the limitations of trees. One of my pet peeves.

      If you are into thinking about set mathematics, then you might enjoy reading from the guys at http://www.dbdebunk.com/. They also have some very pointed discussions about OOP and OODBMS.

      > You don't even need OO

      True enough. Abstracting a database layer in PHP is child's play, with or without OO. In fact, even if you use one of those shiny OO abstraction layers that are so popular in PHP now, you should really be doing some project-specific abstraction anyway. At least, for larger, complex projects.

  73. 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)

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

  75. Um... by Anonymous Coward · · Score: 0

    eBay uses IIS. Note the '.dll' extension on all the URLs it serves.

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

  77. Its the ISPs by KIngo · · Score: 1

    The vast majority of ISPs offer PHP+MySQL as part of their low-cost solutions and not PHP+(any other RDBMS). That's why the vast majority of readers will be interested in excactly this combination.

  78. It's all in a name... by Anonymous Coward · · Score: 0

    Well, maybe not *all*

    But the PostgreSQL folks need some SERIOUS marketing help. I mean if you have a product who's name the average person can't pronounce then you're at a disadvantage.

    Here's a marketing plan for them...

    1. Change the name to FreeSQL
    2. Hire a cute geek-girl who wears trendy glasses to be their spokesperson in TV ads on TechTV
    3. Gain marketshare