PHP and MySQL Web Development
PHPee writes ""Learn the concepts and build the applications..." - PHP and MySQL Web Development is a well-written web developer's guide to using these open source products to create dynamic websites quickly and easily. This book covers everything you need to design, build and debug your own website from the ground up. Special attention is paid real-world issues, like database normalization and site security. Overall, a great reference for beginner and more advanced programmers alike." Read on for the rest of his review.
PHP and MySQL Web Development
author
Luke Welling & Laura Thomson
pages
896
publisher
Sams
rating
9/10
reviewer
PHPee
ISBN
0672317842
summary
From hello world to e-commerce in under 900 pages...
Part Two The following section focuses on MySQL, starting by explaining the advantages of a relational database vs. a flat file storage system. The book assumes no knowledge of databases, explaining simple terms such as tables, columns, rows, etc. It then progresses on to the fun stuff, like designing databases for the web and normalization.
Part Four This section of the book expands on part one, delving into some more advanced PHP techniques, such as interacting with the file system, using network and protocol functions and generating images on the fly with the gd library.
This section also looks at PHP's powerful session functions, including using sessions with authentication and the use of cookies.
Part Five This is by far the most exciting section of the book. Here the reader is presented with seven real-world examples that utilize most of the issues presented throughout the book. These practical projects are presented in an easy to follow manner. The basic problem is presented, and then a solution is proposed. The authors take you from start to finish, outlining the database design, necessary files and functions and show you how to tie it all together. They are also very good at pointing out possible enhancements or alterations, hopefully inspiring the reader to develop their skills and create something beyond the scope of the book.
The seven projects are as follows:
Each of the projects has a real-life application, and can easily be modified to fit the needs of almost any website. The shopping cart application is quite complete, and could serve as a basic cart as-is. The web-based email service incorporates the IMAP and POP3 protocols in an easy to understand manner. And the web forums project discusses the complexity involved in creating a threaded discussion board. It even refers to slashdot as a "fantastic example of a popular website that uses discussion boards" :)
Other info: There are a few minor typos and errors in the book, but nothing to get angry at the authors about. Most of them are quite negligible, but may still create some frustration for beginners. (For example, they make reference to a function isempty(), which does not exist in PHP. The real function is simply named empty()...) Small errors like this may create some confusion, but the errata listed on the author's website are quite helpful, yet not all-inclusive.
The appendices do a good job of showing you how to install apache, PHP and MySQL to get up and running under both Linux and Windows. The book also comes with a CD that contains a PDF version of the entire text, all code examples, and copies of PHP and MySQL so you can set up your own development environment at home.
Overall The book is targeted toward intermediate to advanced programmers, but I'd suspect it would be more useful to the beginner to intermediate group. However, the book is organized in a way that accommodates beginners and more advanced users. If you have previous programming experience, you can probably skip some of the early chapters and jump straight into the larger projects. It's a handy reference book, nonetheless. This book covers almost everything you need to know to learn how to use PHP and MySQL to create dynamic, database-driven websites in no time at all. It does an excellent job presenting some real life projects, and the emphasis on security and clean code is consistent throughout the entire book.
The authors of the book (Luke Welling and Laura Thomson) do a great job of introducing new programmers to the world of PHP and MySQL. The book is divided into five sections which take the beginner programmer through many lessons in solid, secure web programming.
Part Two The following section focuses on MySQL, starting by explaining the advantages of a relational database vs. a flat file storage system. The book assumes no knowledge of databases, explaining simple terms such as tables, columns, rows, etc. It then progresses on to the fun stuff, like designing databases for the web and normalization.
Particular attention is placed on MySQL's privilege system, including proper use of the GRANT/REVOKE commands to give/take away rights for database users. This section is quite detailed and offers a lot more information than I expected. The various column types and associated keywords are also examined in great detail, providing the reader with a solid understanding of MySQL's main features.
Part Three Part Three of the book examines the issues associated with running an e-commerce site. This section is nicely done, looking at common mistakes and how to avoid them. These include things like server security, data backups, keeping detailed logs and dealing with other threats, such as crackers, denial of service attacks and destruction of data. Authentication methods and encryption schemes are also thoroughly covered.
Part Four This section of the book expands on part one, delving into some more advanced PHP techniques, such as interacting with the file system, using network and protocol functions and generating images on the fly with the gd library.
This section also looks at PHP's powerful session functions, including using sessions with authentication and the use of cookies.
Part Five This is by far the most exciting section of the book. Here the reader is presented with seven real-world examples that utilize most of the issues presented throughout the book. These practical projects are presented in an easy to follow manner. The basic problem is presented, and then a solution is proposed. The authors take you from start to finish, outlining the database design, necessary files and functions and show you how to tie it all together. They are also very good at pointing out possible enhancements or alterations, hopefully inspiring the reader to develop their skills and create something beyond the scope of the book.
The seven projects are as follows:
- User authentication and personalization
- Shopping cart
- Content management system
- Web-based email service
- Mailing list manager
- Web forums
- Generating personalized documents in PDF format
Each of the projects has a real-life application, and can easily be modified to fit the needs of almost any website. The shopping cart application is quite complete, and could serve as a basic cart as-is. The web-based email service incorporates the IMAP and POP3 protocols in an easy to understand manner. And the web forums project discusses the complexity involved in creating a threaded discussion board. It even refers to slashdot as a "fantastic example of a popular website that uses discussion boards" :)
Other info: There are a few minor typos and errors in the book, but nothing to get angry at the authors about. Most of them are quite negligible, but may still create some frustration for beginners. (For example, they make reference to a function isempty(), which does not exist in PHP. The real function is simply named empty()...) Small errors like this may create some confusion, but the errata listed on the author's website are quite helpful, yet not all-inclusive.
The appendices do a good job of showing you how to install apache, PHP and MySQL to get up and running under both Linux and Windows. The book also comes with a CD that contains a PDF version of the entire text, all code examples, and copies of PHP and MySQL so you can set up your own development environment at home.
Overall The book is targeted toward intermediate to advanced programmers, but I'd suspect it would be more useful to the beginner to intermediate group. However, the book is organized in a way that accommodates beginners and more advanced users. If you have previous programming experience, you can probably skip some of the early chapters and jump straight into the larger projects. It's a handy reference book, nonetheless. This book covers almost everything you need to know to learn how to use PHP and MySQL to create dynamic, database-driven websites in no time at all. It does an excellent job presenting some real life projects, and the emphasis on security and clean code is consistent throughout the entire book.
You can purchase PHP and MySQL Web Development from bn.com. Slashdot welcomes readers' book reviews -- to see your own review here, read the book review guidelines, then visit the submission page.
mysql.com and php.net are the best reference you can ever get.
Consensus is good, but informed dictatorship is better
I have always been an O'Reilly kind of guy, but I picked this book up and was very impressed. I'm probably catagorised as an intermediate programmer, and I found it intuitive and easy to pick up. Also, the book assumed you had some grasps of the concepts which kept it from being redundant and boring. A very good book if PHP is your second or third language.
This is my digital signature. 10011011001
Recently I've had a chance to do some web design with PHP. Previously I'd used Perl because I'd heard from many people that Perl was the end all and be all of scripting languages for the web. Imagine my suprise to discover that PHP was vastly superior! I know this is a bold statement, but I have solid arguements to support it.
Before I begin, let me just clarify something. I'm not arguing that PHP is better than Perl in all cases. There is certainly still a use for Perl. Also, PHP isn't perfect but it does manage to fix many of the shortcomings I've had with Perl. Here are a few of the things I've noticed about PHP. Finally, I'm not the most talented Perl programmer out there. I generally prefer to use the vastly superior Python, but can use Perl if I have to.
- Ease of use. After about a day I had an excellent understanding of
both PHP and SQL. I was able to get a stable, useable and presentable
website up within 24 hours of reading the basics of PHP. Learning Perl
took me weeks and I'm still not even as good with it as I am with PHP.
I would definitely not recommend anyone new to programming begin with
Perl.
- The OO of PHP is excellent. In my experience, it rivals Smalltalk.
We all know that Perl's OO still needs work (whether or not OO is all
that great is another discussion.) Hopefully Perl will be patched up
so it supports such must-have OO features like introspection,
reflection, self-replication and ontological data-points.
- Outstanding database support. PHP supports virtually every DB under
the sun (although Berkeley DB is missing, oddly enough.) Perl seems
limited to MySQL and PostgreSQL, and its really a kludge for the
later. I've heard that this will be fixed in upcoming versions of Perl
though.
- Speed. PHP is one of the fastest languages I've ever used. While it
won't be replacing assembly or C, its definitely faster than Perl in
almost every case, particularly in regex which has long been Perl's
strongest point. I'm sure there are cases where Perl is equal to PHP,
but I can't think of any at the moment.
- Portability. I can take PHP code off my Linux box and plop it onto
an IIS server, or even one of those new Macintosh servers and have it
run without having to change a single line of code. Try doing this
with Perl! Its as though it was written in assembly, Perl requires
that much rewriting.
- Graphics. PHP comes with a nice little graphics library. While I
wouldn't use its to code the new Doom (VB would be a better choice)
its adequate for most web pages, and should be considered as a
substitute for Flash for certain things. Perl lacks a graphics library
of any kind.
- Data Structures. Under PHP you can create any type of datastructure
you need: Linked lists, binary trees, hash tables, queues, inverse
Reiser-biased recursion trees, etc. Under Perl you're extremely
limited in what you can do. This is because Perl isn't OO (so you
can't create Node classes, for example, usefull in a linked list) and
because it lacks pointers. Some of you may notice that PHP lacks
pointers, but look deeper! Behind the scenes, hidden from the user
pointers are used. Because of this, PHP can support complex data
structures.
Again this is just my experience. I don't mean to offend any Perl coders because Perl was an excellent language. However, in certain cases it may behoove one to write the back end in PHP instead of Perl.-Mark
This book has been out for a couple of years now. Don't know why this needs to be posted.
Apparently, a distribution of Linux comes on the CD as well... Here is the book on linux.org
Ah am not a crook! (\(-__-)/)
I got this book over a year ago and I must say that, while I enjoy it and it is well written, I would agree that it is more for an inexperienced programmer. As someone who knows a bevy of languages, the hand holding wasn't really useful and ultimately if I had a problem with PHP syntax, I didn't go to the book, I went to the PHP docs from php.net. I find the online documentation for PHP is some of the best documentation I've ever seen for a language. I did use the MySQL sections a bit just to check on syntax for MySQL commands, specifically setting up user permissions and such. This was, in part, due to the documentation provided by the MySQL people - which is a bit lacking. But the presentation of the information on MySQL was always set up as sort of a walkthrough of your typical needs. When you need to stray from this, that's when you need to consult other sources OR start guessing. I suppose I could have benefitted more from a book purely on MySQL, use the online PHP docs, and maybe save some money! Oh, one other complaint I had was that they attempted to cover some aspects of SQL but really didn't provide enough of a description to be able to 'know' SQL. And they didn't hit normalization in any effective way whatsoever but, luckily, I already know all I need to know about normalization. I guess to sum up my review: it's a good book if you are implementing something simple and don't already know how to program that well. But if you've got a large-scale LAMP project it might be best to get some standalone reference texts for each. And now, I'll suggest a few:
Fundamentals of Database Design is a great book for learning about normalization of a database into any of the many forms.
MySQL by Kofler is my favorite book on MySQL.
As for a pure SQL reference, just go with O'Reilly. Have a great day!
I hate liberals. If you are a liberal, do not reply.
"Overall, a great reference for beginner and more advanced programmers alike."
I'm not a big fan of books that are targeted at both beginner and advanced programmers. Authors and publishers attempt to target their product at all available readers, but I find myself skipping chapters in some books (either early or late). What have you found?
To be honest I'm not sure you really need a book to learn PHP or MYSQL, both of these have excellent websites which cover their respective topics extremely well.
I have bought a few PHP books, the wrong ones I think, and none of them have come close to being as informative or as useful as the website.
The other thing with PHP is that there are now so many free projects using PHP it is often a lot better to look at they are coded, I think you gain a lot more pratical knowledge this way than you could glean from any book no matter how exhaustive.
I am of course speaking from the perspective of someone who was familiar with programming and scripting before I came to use PHP but maybe it is better to get a book or learn programming theory before you come to apply it to a language. Although languages are different once you know what you want to do you can usually apply your general knowledge to the language without too much trouble and in the process I think gain new persepectives on what is a right or a wrong way to do something.
This book is great... not only as a beginning to PHP and to mySQL, but also for combining the two into an extremely useful tool. I used the book for an independent study I did my junior year of college, and I still pull it out for references even when PHP is not the language that I'm using to interface with my mySQL server. It is great and easy to read.
I hardly ever use perl anymore, first of all I find that phphome is amazing, a really great resource, and second, exactly what can you do with perl that you can't do with php??? Third I find it about 3X profitable to just use static pages with some basic markup.
Now, I'll admit, I used to be rather pro-perl, but as they say, A programmer who's under 30 and uses php has no heart, and a programmer over 30 who doesn't has no brain!
Karma: Bad (mostly affected by being such an asshole)
PHP is essential, but MySQL is not stable enough for a real 24x7 web service. The lack of stability of /. probably a good example of this point. And my experience at work also bears this out. We're going to greath lengths to replace all MySQL servers with something else which is actually reliable.
Someone showed me a quote on the web that said something like, "MySQL is quite stable - I'm able to run for 100 days without restarting it!" That's hardly the definition of stable in my book. Unless you're a hobbyist, or have very few servers and can tolerate some unscheduled downtime in your service, there is no place for MySQL in a web service. Especially when you've got dozens, or even hundreds, of SQL servers. It becomes extremely burdensome to keep them all running, and to write software which is tolerant of SQL server downtime.
I know this is going to sound terribly odd (and might make me come off as a total n00b) but I'm going to go out on a limb here and say that PHP doesn't need a debugger (at least not yet). Really, I've been playing around with PHP for months now, playing around with string functions, loops, databases, recursion, and the like and I've never need any debugging tool more advanced from echo.
I've found that it's very hard to make insidious and hidden errors in PHP if you just plan your code well and are familiar with the language. Most of the errors I make in PHP tend to be of the "Oops, missed out a semicolon" variety, so the simple one-line error "Parse error at line X" is generally enough for me. Even the most complex errors I make (such as when mysql_num_rows complains about a variable not being a MySQL result) is due to something boneheaded and reasonably obvious, like forgetting to connect to a database or missing out a line of code.
Even without a debugger, I've never had to puzzle over any PHP problem for more than a few hours.
Note to M1-ers: a curt but otherwise insightful message is not "Flamebait" or "Troll".
I agree that the book is a good one (and I built my site after reading it). However, it reflects life at the dawn of PHP 4.0, and several things (particularly on PHP now shutting off globals by default, and changes on session control) now lead the user into some frustrating debugging sessions under 4.2.x onwards. At least until the PHP newsgroups and some of the more modern PHP books come to the rescue. I'd add "PHP Cookbook" (O'Reilly), "PHP Developers Cookbook" (SAMS) and "Web Database Applications with PHP and MySQL" (O'Reilly) alongside this book as good supplements to the more dated Welling/Thomson work. At least until they update it...
Considering all the work that O'Reilly has already done with educating users on web serving on OS X with Apache, PHP and MySQL already, I'm surprised that they wouldn't even bring it up in a supposedly comprehensive beginner/intermediate book. Left hand/right hand, perhaps.
Very handy for cut-and-pasting long chunks of code without having to retype it while reading the page.
Here's the link to read PHP and MySQL Web Development as reviewed here.
I bought this book a few years ago. I found it very helpful as a beginner programmer. Unlike some books which just teach you the concepts, this book show you how to use them in real world applications. Alot of code you can basically reuse in your own projects. I reccomend the book to anyone who wants to learn how to use php and mysql together.
---
Always standing, I am a tree awaiting the lightning. -Samael, Crown
Just as long as people are taught to apply a 6 month old patch so their SQL isn't being pinged into oblivion :)
SecondPageMedia - Wha
The book is pretty good, but tends to gloss over some of the more technical issues of PHP. In addition, the book tries to cover so much that there are a few parts that are missing some of the more complex details. For example, the section on PHP Session Management was a little too brief for my liking, and ended up being supplemented with material from http://www.php.net
These were are fairly minor issues and the only really *serious* issue I had with the book was the section on MySQL installation. It made the installation look so simple and straightforward, when in fact it was not. I attempted installing MySQL on several different boxes under both Mandrake and Redhat. In the end, the MySQL server was installed on a secondary machine under FreeBSD, where it installed without a hitch.
PHP and MySQL Web Development
Luke Welling, Laura Thomson
Paperback, March 2001
How long does a book need to be out before it gets reviewed? Is it still viable after almost 2 years?
I feel it dosnt touch the configuation and running of a mysql database very well.. you get a few dabs of enlightenment here and there but really it should be the first thing every mysql+php developer should know and understand.. and so should have more leafs dedicated to it. still its a great book and I would part with it.
O'Reilly has a great service called Safari where you can read the entire book, searchable and everything, on their website.
Great link indeed. Too bad you can only use the full version for 14 days free.
Still $14.99 / month isn't _so_ bad, if you really would use these...
I demand the Cone of Silence!
And so it's very out of date. This may go without saying, but PHP has had a lot of improvements and general tweaks made from then. Some of these tweaks may prove frustrating.
For example, in php.ini register_globals is now set to 'Off' by default (from 4.2 onwards) instead of 'On' and if the examples in the book assume that it is turned 'On' it means that the code samples in the book will cease to work. (For example, if the book uses '$subject' as opposed to '$_POST["subject"]' they could be in for it.)
Even assuming that the book doesn't assume that register_globals is on, there's another problem. Being of version 4.0, it won't use the get and post array variables $_GET and $_POST but rather the deprecated $HTTP_GET_VARS and $HTTP_POST_VARS.
There are other slight differences. For example, PHP 4.0 doesn't have the functions require_once and include_once, which are useful for making sure you don't accidentally include a file more than once (brilliant for avoiding function redeclaration errors) and the output buffering could be messed up by an incorrect setting in the php.ini file (implicit_flush, if you're wondering).
Plus it doesn't have useful string functions like strcoll and vsprintf).
Note to M1-ers: a curt but otherwise insightful message is not "Flamebait" or "Troll".
I've not heard of PHP being slow before. I've been using it for 3.5 years and I've been very impressed by it's speed.
Gee, let's bitch about a free, lighting fast database that gives 95% of users what the need, but charges for a small, specialized add-on.
As for a debugger - how many PHP developers have a need for a debugger? There are some, you say? I agree, and for those folks they're hopefully using a decent templating engine like Smarty which includes a very slick debugging window.
Sure it is. It'll still be viable when it's reposted in a couple weeks. :)
Ah am not a crook! (\(-__-)/)
I know this is a shameless plug, but it really is flawless. Install MySQL, install PHP, then do a google search for the RPM which automatically integrates the too. Bada-boom, bada-bing.
www.cgisecurity.com/lib
Consider that each page is a mini-application... and before you would have to worry about needing a destructor... the application has completed... and all memory/resources are relased...
BlackNova Traders
in the subject line
And I've been programming since the Pet/Apple ][/Atari days.
I wanted to make some changes to my website last year to take advantage of a MySQL database. While the O'Reilly Reference at the time got the database configured fine, it was more of an issue of getting the database tied into the website.
I picked up this book and within four hours it was up and running, and coded near-perfectly on the first run (there were some minor tweaks that need to be made for format).
While I agree that there are some great resources for PHP and MYSQL on the web, it doesn't exactly lend itself to armchair (or bathroom) reading. The other problem with the web is that I've found it hard to find step-by-step tutorials, versus code that focuses on a specific command or feature. Once you're familiar with a language, those resources are excellent. But when you're just starting to dabble, it's good to have a reference that takes you step-by-step through the process (even if you end up only skimming 75% of it).
I think the best testimony I can give for this book, is that after using it to get my site up, I lent it to one of the web programmers at the office (and let's just say that my company is a well-recognized name in the computer industry).
I haven't seen the book for six months.
Dr. Wu
1. I've always found that the comments are helpful marginalia which can point out obscure cases where PHP might fall over, an alternative function which will work better than the one you're looking up, etc.
and...
2. If the user notes bother you, you can download the entire manual in HTML as a BZ2 archive (it's about 830KB) from the PHP website.
Note to M1-ers: a curt but otherwise insightful message is not "Flamebait" or "Troll".
here's what i discovered:
my point is this. i use perl to process much on the back end, maybe just 'cause i am so familiar. now, i simply save all my
My problem? I was perfectly gruntled, until some numbnuts came by and dissed me.
1. Amazon has it cheaper than BN by $5.00. And they have free shipping (vs. $4.00 min for BN)
2. The second edition of the same book is coming in about 3 weeks (Feb 13), so you may want to wait for that.
And the shebang becomes irrelevant.
I have never had any problems with php, because of the excellent, (almost?) clearly written documentation.
However what have suprised me on local php developer forums is that people completely new to any kind of programming find the site very technical and difficult to understand. Therefore will they often seek for alternative resources, like books or websites.
As you mentioned the free php projects, I have to say that I don't think that you can get very much out of those. I find it much better to look at small snippets than large projects, because it's much easier to understand. Especially for beginners.
I demand the Cone of Silence!
1. Cars
2. People
3. Books on using MySQL with PHP
No artist tolerates reality. -- Nietzsche
I don't know the book...if teh book is outdated, then the review shouldn't be posted now, but if tehbook is stil useful, why not?
A few months ago, I decided that I was going to add PHP to my resume. This book is great, even for those of us who have already programmed in other languages. This book is also a great reference for MySQL, and a lot of its conversion functions for dates and passwords.
The last couple chapters are about reinventing the wheel: writing a web forum and writing an email client. Even though there are many open source projects in these categories, the database design concepts behind the chapters is of great value.
I'd reccomend this book to anybody of ANY skill level in programming who wishes to learn PHP and MySQL. I haven't had my copy back for a few weeks now because so many of my friends in the comp sci department here want to borrow it.
I was initially going to link to this or this article, but the first included this memorable quote:
Mmmmmm... Soft, chewy center...
The Zend Studio PHP debugger is not that bad. It's part of an integrated IDE which includes nice support for remote debugging.
I've never quite understood the attraction of PHP over Perl (using e.g. Mason or Template to get the templating capability). This isn't a troll, this is a real question. What does PHP do better or easier than Perl plus a templating engine?
When all you have is a hammer, everything looks like a skull.
I was a noob PHP programmer several months ago. With this book combined with the downloadable HTML references at php.org and mysql.net, I learned it in no time. This book makes a great supplement to the official references b/c it provides a plethora of examples that demonstrate how to do certain techniques that are not always readily apparent.
Flying is easy, just throw yourself at the ground and miss. -Douglas Adams
nm
Flying is easy, just throw yourself at the ground and miss. -Douglas Adams
The stuff in this book is so simple that php.net and mysql.com would be better resources. I'll tell you what: if you can find me a book that tell me how to do proper database result caching in PHP/MySQL then I'll be impressed.
As it is now I end up writing a DB caching class for each app I write because I have to customize it so much to get any speed benefit (since you can't do any real caching). One method will not work on another app very well, depending on the number and types of queries.
IMO, Zend is holding PHP back. By crippling the language it forces you to buy the Zend Performance Suite to get good performance on an enterprise app. Unfortunately, this same crippling also makes making that enterprise app difficult and is why Java is better in the first place.
The global economy is a great thing until you feel it locally.
I'm not a great programmer, but why would you need destructors in php?
Doesn't it release resources upon each page completion?
and the shebang becomes irrelevant.
But to get this comment back on topic, the review is about a Sams book, not the O'Reilly book on the same topic.
Picky, picky ,picky.
The simple truth is that interstellar distances will not fit into the human imagination
- Douglas Adams
This guy really needs to get a life!
Congratulations! Now we are the Evil Empire
Recently I've had a chance to do some web design with PHP. Previously I'd used Perl because I'd heard from many people that Perl was the end all and be all of scripting languages for the web. Imagine my suprise to discover that PHP was vastly superior! I know this is a bold statement, but I have solid arguements to support it.
Before I begin, let me just clarify something. I'm not arguing that PHP is better than Perl in all cases. There is certainly still a use
for Perl. Also, PHP isn't perfect but it does manage to fix many of the shortcomings I've had with Perl. Here are a few of the things I've
noticed about PHP. Finally, I'm not the most talented Perl programmer out there. I generally prefer to use the vastly superior Python, but
can use Perl if I have to.
* Ease of use. After about a day I had an excellent understanding of both PHP and SQL. I was able to get a stable, useable and presentable
website up within 24 hours of reading the basics of PHP. Learning Perl took me weeks and I'm still not even as good with it as I am with PHP.
I would definitely not recommend anyone new to programming begin with Perl.
* The OO of PHP is excellent. In my experience, it rivals Smalltalk. We all know that Perl's OO still needs work (whether or not OO is all that great is another discussion.) Hopefully Perl will be patched up so it supports such must-have OO features like introspection, reflection, self-replication and ontological data-points.
* Outstanding database support. PHP supports virtually every DB under the sun (although Berkeley DB is missing, oddly enough.) Perl seems limited to MySQL and PostgreSQL, and its really a kludge for the later. I've heard that this will be fixed in upcoming versions of Perl though.
* Speed. PHP is one of the fastest languages I've ever used. While it won't be replacing assembly or C, its definitely faster than Perl in almost every case, particularly in regex which has long been Perl's strongest point. I'm sure there are cases where Perl is equal to PHP, but I can't think of any at the moment.
* Portability. I can take PHP code off my Linux box and plop it onto an IIS server, or even one of those new Macintosh servers and have it
run without having to change a single line of code. Try doing this with Perl! Its as though it was written in assembly, Perl requires that much rewriting.
* Graphics. PHP comes with a nice little graphics library. While I wouldn't use its to code the new Doom (VB would be a better choice)
its adequate for most web pages, and should be considered as a substitute for Flash for certain things. Perl lacks a graphics library of any kind.
* Data Structures. Under PHP you can create any type of datastructure you need: Linked lists, binary trees, hash tables, queues, inverse
Reiser-biased recursion trees, etc. Under Perl you're extremely limited in what you can do. This is because Perl isn't OO (so you can't create Node classes, for example, usefull in a linked list) and because it lacks pointers. Some of you may notice that PHP lacks pointers, but look deeper! Behind the scenes, hidden from the user pointers are used. Because of this, PHP can support complex data structures.
Again this is just my experience. I don't mean to offend any Perl coders because Perl was an excellent language. However, in most cases it may behoove one to write the back end in PHP instead of Perl.
Thank you and God bless,
Egg Troll
C - A language that combines the speed of assembly with the ease of use of assembly.
Seems like there's tons of books on PHP and MySQL. Not to troll, but why doesn't someone release a book on PHP and PostgreSQL? It really is a better database, and does things in a somewhat more standardized way than MySQL.
Not that I would need such a book (since I already know the combo fairly well), but I'd like to be able to recommend PG to people over MySQL, and some would find a book like this useful.
FYI a new Edition of this book which has been updated to include PEAR stuff, XML stuff, and various minor fixes will be in a book store near you around mid-February.
--- Nothing To See Here ---
Im having huge problems with safari atm, one of their servers that seems to serve my portion of the internet is returning 0 byte replies, basically jsut header information and nothing else. I have emailed them and so far im getting no response. I can use it at work but my traceroutes end up at a totally different server, so im guessing they have round robin servers for different routes to their site.
MySQL is not a database. A database is a collection of data.
MySQL is not a full DBMS either, because it leaves things like transaction control to the application unless you take some extra steps (InnoDB).
MySQL is not relational, SQL violating several relational prescriptions and proscriptions and MySQL not even raising to SQL's already faulty levels.
Leandro Guimarães Faria Corcete DUTRA
DA, DBA, SysAdmin, Data Modeller
GNU Project, Debian GNU/Lin
I've found that the best reason to use a book is the option to just sit and read, away from the computer. Other good reasons include being able to scribble in the corner and underline or highlight exactly what you might want to refer to.
I will grant you that it is rare to find a good pure reference book, and that for reference purposes web sites are usually better. I would propose that unless you have a large display, a broadband connection, and plenty of patience for hunting through disconnected information to make a coherent whole, using a book as a coherent whole to start with is generally an easier way to learn. (Though obviously, ones own habits/tendenancies might override this.)
And yes, I picked up this particular book and am working through it in my spare time, so to speak. Having worked with other scripting and database languages before, I found parts of it skipable or over-talkative, but it does give good information. My biggest complaint is that it doesn't have instructions on how to set up in OS X. However, going back and forth with it and information on Marc Liyanage's pages, I was able to get everything working reasonably easily.
R: That voice. Where have I heard that voice before? B: In about 365 other episodes. But I don't know who it is either.
A new edition comes out next month that will probably address all of your concerns:
c us trec_gl_acc/002-0167781-3203215
http://www.amazon.com/o/ASIN/067232525X/ref=cm_
I picked this book up a couple months ago and so far I've been very impressed with it's blend of advanced tutorials and beginner breakdown. I have nominal programming experience with ASP and Javascript, and it quickly highlights a lot of the strengths of PHP over both of those languages. I haven't gotten into any of the MySQL stuff yet, but I assume it will be just as well written.
Total-noob> but I'm going to
Total-noob> go out on a limb here and say
Total-noob> that PHP doesn't need a
Total-noob> debugger
That sounds like something that a sales 'droid
said to my manager concerning a 4GL back in the
early '90s. My manager bought it. I have to
admit that, in the beginning, I was taken in, too;
but in the end this turned out to be an instance
of wishful thinking.
We tried to develop a modest user interface to
track the flow of materiel through a shipyard in
this 4GL. Of course, the implementation tuned out
to be much more intricate in the real world than
it had seemed to be in the 'blue sky' concept and
planning meetings.
End result: the 4GL code was almost impossible to
maintain. Eventually the project failed --for a
combination of reasons, to be fair. Here is a
king of maxim that I took away from it though:
Every line of code that is ever written will have
to be
1-debugged
2-maintained
I could have modded him down, but then I'd get moderated as "Unfair" by some M2er who doesn't take the time to see the syntax.
Check out his posting history and you'll see that this is just a karma whoring post so he can build up his points.
I definitely agree. The arrangement of the topics make it very easy to use as either a reference or cover-to-cover book. It's introduced me to a lot of features that I didn't know existed in the PHP world.
PostgreSQL instead of MySQL is certainly a great improvement. But why stop on it? Python is much better than PHP as well. So, all we need is "Python and PostgreSQL" book. Or prehaps, "Zope and PostgreSQL". Any authors around there? Anyone to volunteer?
Less is more !
The book is about MySQL. Slashdot is based on MySQL and it's way too slow. And now the comment about such fact is moderated as "Offtopic"? That's not very nice. You can moderate it down and down, but you cannot hide the fact that the main reason that Slashdot is slow is b/c it's implemented with MySQL. That was a wrong technology choice for such class of web-applications as Slashdot is you cannot hide using your moderations.
Less is more !
I had already started using PHP and MySQL, but after going through this book (and I did pretty much read it front to back) I had a much better idea of what *could* be done with PHP and MySQL.
Now I've built a couple of special-purpose content management systems, and with the framework the book gave me, I'm able to better use the resources available on the web.
BTW, I think you can safely extend LAMP to LAMPS (Linux, Apache, MySQL, PHP & Smarty).
bp
What comes first, MySQL 4.x Stable or PHP 5 Stable? Don't know which I've waited longer for, one of those or Duke Nukem Forever.
Please define Slashdot's "class" of web application. I would think it fits the standard high volume message board. Drlaura.com and a number of other high-volume message boards all use mysql+php. I suspect Slashdot's slowness is a combination of bandwidth and hardware bottlenecks rather than blatant performace issues. Nobody (much less Slashdot admins) would stand for that. To do what? Get more popularity from the 'in' crowd? To make friends with the Zend circuit? There would be no real point.
Often wrong but never in doubt.
I am Jack9.
Everyone knows me.
Perhaps this posting was intended to refer to the newest version of the book?
I would suggest that anyone interested in this book either buy it used or wait two weeks for the next edition.
PHP and MySQL Web Development, Second Edition
team up and create a single documentation download for developers. Since virtually everyone using the 2 would be running a local webserver - why not offer a download with a MySQL database dump file of the docs, with some PHP pages to use to set it all up and as the search engine to look stuff up? It would surely be easier than having to scroll through pages for that function you've forgotten the name of - or for other functions that may be more appropriate!
I'm thinking of doing this myself, BTW - pumping all the PHP docs into a db for my own use - maybe the Perl and Java docs too for a single nice web search..
Code, Hardware, stuff like that.
what can you do with perl that you can't do with php
I was always very pro-Perl, but I find myself using PHP for just about all web scripting now. I still use Perl for command-line stuff though, as I just know it better I guess. However, unless I've missed something, the biggest problem I have with PHP is that you can't run it through suexec (I understand why), so all PHP scripts run as the web server UID. This has often lead to me using a mixture of Perl+PHP (usually Perl scripts running via a cron-job).
I only use Apache1.3x though, since Apache2+PHP is pretty dire at the moment - so maybe they'll allow some equiv of suexec when Apache2 is ready for use...
Code, Hardware, stuff like that.
A lot of "write" operations changing the result returning by the same URL request (so caching is not a real help).
Few months ago I did the test comparing the overhead of Bugzilla when it's implemented with MySQL vs PostgreSQL (I have to choose between them for very weak hardware). PostgreSQL was keeping up much longer than MySQL on massive concurrent write-requests when increasing amount of concurrent users (actually concurrent test scripts) simultaniously publishing new bugs and new bug comments and changing bug status.
I wonder if Slashdot developers tried similar tests with their software between MySQL and PostgreSQL.
Less is more !
That's what happens when I just skim a function's manual page. I misread 4.0.1 as 4.1.0. Sorry to all who read my parent; it's got a factual inaccuracy error in it. (Insert embarassment here.)
Note to M1-ers: a curt but otherwise insightful message is not "Flamebait" or "Troll".
I wholeheartedly agree. That's how I learned PHP; I read the code of others, skimmed the manual, started editing the code of others, read the manual for bits I didn't understand, skimmed the whole thing again, then started making my own projects, using nothing but the manual (and the occasional snippet of other people's code) for reference. When you get good enough you can start to get a feel for the idiosyncracies of your favourite language; in my case, PHP. I know when you'd use $_POST instead of $HTTP_POST_VARS and why you should use $_POST["subject"] instead of $subject.
Note to M1-ers: a curt but otherwise insightful message is not "Flamebait" or "Troll".
Some of you seem to have slightly misinterpreted my comments. I didn't mean to say that a debugger isn't at all necessary or wouldn't be helpful; I was just saying that I've found PHP is the kind of language where with sufficient planning you can eliminate the need for a special debugger in 80/90/99% of cases.
Of course, having a debugger for PHP would be very useful, but I wouldn't consider it to be a very high priority, especially as someone else in this thread seems to have posted a link to a reasonable (though still alpha) PHP debugger prototype which works well.
Note to M1-ers: a curt but otherwise insightful message is not "Flamebait" or "Troll".
Please post a comment signed in in reply to one of my other posts or within my journal so that I can identify you and add you to my foes list. Thank you.
I hate liberals. If you are a liberal, do not reply.
While they do an good job targetting both beginners and advanced users, it really does a good job with beginners that have little programming experience. Someone coming from C++ or Perl could probably figure out what a given amount of code does, wouldn't something like this look a wee bit intimiating to a newbie:
$dbh=mysql_pconnect('127.0.0.1','uname','passwd')
mysql_select_db('customers');
$query = 'select * from TABLE where ID > '.$minID
$result = mysql_query($query,$dbh);
How many slashes would a slashdot dot, if a slashdot could dot slashes?
The minimal plan actually starts at $9.99. There's also $99 per year, which comes down to even less.
Some day I will have mod points, so add me to your friends.
its a pretty good book. i read it about a year and a half ago and learned the basics of both technologies (PHP/MySQL). there were a lot of typos, sloppy writing and oversimplifcation, though .. and PHP has moved on since then - the deprecated register_globals config flag versus the new superglobal arrays, for instance .. so i hope theres been a revision and an update
[ UNSIGNED NOT NULL ]
no its not
I found this problem when I wanted to use the cURL library with php on iServer.
Besta é tu si você não viver nesse mundo!
http://www.amazon.com/exec/obidos/tg/detail/-/0672 32525X/qid=1043724342/sr=1-3/ref=sr_1_3/103-193927 5-1482235?v=glance&s=books
PHP and MySQL Web Development, Second Edition
by Luke Welling, Laura Thomson
List Price: $49.99
Price: $34.99 & This item ships for FREE with Super Saver Shipping. See details.
You Save: $15.00 (30%)
Availability: This item will be released on February 13, 2003.
Edition: Paperback
Thanks Amazon(TM)
You have a sick, twisted mind. Please subscribe me to your newsletter.
1. People who reflexively complain about the inferiority of PHP and MySQL
2. People who use PHP and MySQL, giving those of us who know better something to complain about
Cheers
Is there a similar book that can be recommended for Perl/MySQL or modPerl/MySQL that uses the same type of structure as this book?
Should I be looking for Perl or modPerl "cookbooks"?
I started with Programming Perl 2nd edition, as I was told that "we are programmers!" and that the Learning Perl book sucks, not to waste money on it, and it is "banned" from the Perl 1 class I took. Well, the class was very condensed (short hours, few classes), this was my first programming language, and it was over my head. I also had other projects going on at the same time, so couldn't devote the time to it. I ended up buying the Learning Perl book anyway, as I knew I needed a good foundation. But the book doesn't have any real world examples in it, which is what I need.
From the description of this book, both in the review and in the comments, this book would be good for me, but I'm not interested in php. I have several php books already, and know I'll be using perl/modperl rather than php. So what should I be looking at that is similar to this book, and has similar real world examples, but is written for perl or modperl, and not php?
tia
Is there a book that can be recommended for Perl/MySQL or modPerl/MySQL that uses the same type of structure as this book?
Should I be looking for Perl or modPerl "cookbooks"?
I started with Programming Perl 2nd edition, as I was told that "we are programmers!" and that the Learning Perl book sucks, not to waste money on it, and it is "banned" from the Perl 1 class I took. Well, the class was very condensed (short hours, few classes), this was my first programming language, and it was over my head. I also had other projects going on at the same time, so couldn't devote the time to it. I ended up buying the Learning Perl book anyway, as I knew I needed a good foundation. But the book doesn't have any real world examples in it, which is what I need.
From the description of this book, both in the review and in the comments, this book would be good for me, but I'm not interested in php. I have several php books already, and know I'll be using perl/modperl rather than php. So what should I be looking at that is similar to this book, and has similar real world examples, but is written for perl or modperl, and not php?
tia
Yes..
but in some cases when you utilise a function for example that may use a LARGE amount of system memory such as a multi-dimensional hash/array that uses a 'reiterating' loop form of function you may definitely want to clean up your arrays/hashes after each reprocessment of the loop in order to save on resources and be more efficient..
Thats just one example though