Web Database Applications with PHP & 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
the online documentation at php.net and mysql.com is excellent, so beginner books are unneccessary.
Fleur de Sel
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.
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.
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.
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
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
when did apache, mysql, and php stop working on OpenBSD, FreeBSD, Solaris, etc etc?
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.
.Net is where the future is...
Forget PHP, forget Perl, forget Python & Ruby.
-- Windows security? Sure, which ONE would you like? -me
...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
Use mod_perl.
1;
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...
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
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
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.
But this history of PHP says that I'm right.
I have been pwned because my
You dont really need a book, but I bought one back when I first started php/mysql it was really helpful. Link Here.
In college, really poor, need a flatscreen.
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.
www.cgisecurity.com
www.owasp.org
www.sqlsecurity.com
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
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.
Michael C. Hollinger
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.
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.
The 'P' in LAMP refers to Perl/PHP/Python.
No, Thursday's out. How about never - is never good for you?
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.
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--
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.
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
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.
Is right here.
"I told you a million times not to exaggerate!"
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.
UNIX/Linux Consulting
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.
A beginners' guide to Portland, OR?
$row->firstname\n";}
$row->firstname\n";}
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?
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.
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.
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.
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!
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
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?
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.
You're right. Sorry 'bout that.
Two week old baby. Up all night.
Need Sleep...
The opposite of progress is congress
javah, j2ee
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
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.
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
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.
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
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.
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
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.
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.
Straight cut and paste job aie?
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.
Less is more !
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.
Please, no more PHP/MySQL books.
No artist tolerates reality. -- Nietzsche
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.
http://perl.apache.org/embperl/
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.
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?
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. :)
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.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.
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.
creation science book
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.
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!)
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.
Property for sale in Nice, France
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.
Linuz Zope PostgreSQL?
- 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.comLess is more !
I've used both php and python and I must say that python code is WAY easier to maintain.
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.)
(* [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
Table-ized A.I.
(* 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)
Table-ized A.I.
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.
eBay uses IIS. Note the '.dll' extension on all the URLs it serves.
(* 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.
Table-ized A.I.
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.
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