Follow Slashdot blog updates by subscribing to our blog RSS feed

 



Forgot your password?
typodupeerror

Beginning PHP and MySQL 5.0 142

Posted by samzenpus
from the getting-started dept.
Ravi Kumar writes "PHP and MySQL use is so prevalent that nowadays it is hard to miss seeing a website on the net which has been built using these technologies. The beauty of PHP is in its open nature and the rich set of libraries and modules which imparts a lot of power and flexibility to the programmer. Similarly MySQL is a free database which is ideal for use as a backend for any website. And not surprisingly there are a plethora of books in the market which explains these two topics. One such book is Beginning PHP and MySQL 5 from Novice to Professional authored by W.Jason Gilmore published by Apress." Read the rest of Ravi's review.
Beginning PHP and MySQL 5.0 - From Novice to Professional
author W.Jason Gilmore
pages 860
publisher Apress
rating 9
reviewer Ravi Kumar
ISBN 978-1-59059-552-7
summary The beauty of PHP is in its open nature and the rich set of libraries and modules which imparts a lot of power and flexibility to the programmer. Similarly MySQL is a free database which is ideal for use as a backend for any website.


Spread over 860 pages and divided into a whooping 37 chapters, this book covers the PHP Language and MySQL database in detail. As the name indicates, the book endeavors to hand hold a newbie in the various aspects of PHP programming like the language constructs and progressively brings him to the level of a professional. The first 21 chapters of the book solely concentrates on PHP where the author explains with the aid of examples how to write good programs in PHP.

The author starts the narration by giving a brief history of PHP and then moves on to explain all the syntax constructs of this language in great detail. Arrays, functions and classes have each been provided separate chapters of their own. Usually I have found many books related to programming jumping straight into describing the language syntax and about writing code. But this book has a dedicated chapter each covering how to setup and configure PHP and MySQL on ones machine irrespective of the OS being used which breathes some fresh air to this subject. PHP language has a very good similarity with C/C++ at-least in the syntax. And in the sixth chapter, the author explains the Object Oriented Concepts like object cloning, inheritance and polymorphism of this language with clarity.

The maturity of any programming language is gauged by the type of traps that it has developed to check the errors and exceptions that might be generated dynamically when a program is run. PHP has a rich set of features for handling errors. Earlier versions of PHP already took care of notifying errors through configuration directives and support for logging. But one thing this robust language lacked was support for exception handling. And from PHP ver 5.0 onwards, this feature has also been included in it. The 8th chapter in this book titled Errors and Exception Handling explains all these important concepts in detail. The fact that the author has provided snippets of code to illustrate each concept that is explained goes a long way in understanding this topic.

Another of PHPs strengths is in its support of a rich set of regular expressions and string manipulation functions. Using regular expressions, one can match just about any string or a sub-set of it and even do manipulations to the matched string on the fly. The string matching functions form the backbone of many user input validations. In the 9th chapter titled "String and Regular Expressions", the author explains with the aid of code how to use the rich set of string manipulation functions available in PHP to get the desired results.

The 10th chapter is solely dedicated to working with files and operating systems where the author explains in his inimitable style different ways of reading from and writing to files. All the frequently used file manipulation functions are explained in this chapter with the aid of examples.

The first 12 chapters of the book solely concentrates on explaining the PHP language to the readers. In the next 4 chapters, the author moves into practical aspects like explaining how to mix PHP with HTML elements, user authentication , handling file uploads, sending and receiving email using PHP code and so on. I found the section where the author explains how to build specialized programs such as a port scanner, subnet converter and bandwidth tester all with the aid of PHP code really fascinating. The author introduces the reader to some of the MySQL concepts in this part of the book like connecting to a database and reading data from database but the more detailed aspects of database manipulation are left for later chapters which deals with MySQL in more depth.

The 21st chapter titled Secure PHP programming throws light on topics related to enhancing security while coding in PHP such as enabling safe mode for people who run PHP in a shared-server environment, PHP's encryption capabilities, securely configuring PHP via its configuration parameters and so on.

From the 22nd chapter onwards, the book takes an all together different turn and moves into explaining the database concepts which plays an important part in any dynamically generated website. More specifically, the succeeding chapters concentrate on explaining the configuration and use of MySQL 5.0 and how one can use PHP to interact with the MySQL database. The chapter titled Introducing PDO throws light on the abstraction layer used between PHP and MySQL. I especially liked the 26th chapter where the author lists the different MySQL clients which are available to the user like mysql, mysqladmin, mysqlshow and so on. In fact, each and every tool which comes bundled with the mysql server is explained thoroughly with the aid of examples. But that is not all, this chapter also explains how to configure a mysql database using third party clients like PHPMyAdmin, MySQL Query Browser, MySQL Administrator and Navicat. In the section on securing MySQL, the author goes into the finer nuances of the topic. For example, with the aid of commands, the author explains how to make sure that the user connects with the database over secure sockets layer (SSL) or ways of encrypting the MySQL database traffic which is an eye opener.

But I would say the 29th chapter titled PHP's MySQL Extension is the most important chapter in the entire book just because it is in this chapter that the author explains in detail the variety of ways in which one can connect to MySQL database and retrieve or manipulate the data using PHP code.

In the 30th chapter titled PHP's MySQLi Extension, one gets to know how to use the enhanced MySQLi extension to connect to the database. The MySQLi extension contains more enhancements over its predecessor in that it is object oriented, supports prepared statements, provides transactional support, has better debugging capabilities among other things. But the down side as the author puts it is that it requires PHP 5.0 for it to work.

The last six chapters deal with special features of MySQL and how one can write PHP code to use those features. The features like stored routines, MySQL triggers and Views have been provided with a dedicated chapter of their own. And yes, from MySQL ver 5.0, support for views have also been incorporated in the database. And the fact that this book covers these new topics in detail makes this a truly useful book not only for budding programmers but also for the gurus among us.

I really liked the layout of the book. Each section is accompanied by PHP code snippet which shows how it is done. Just because one gets two books at the price of one does not mean that the book is short on detail. In fact the opposite is true and the 860 pages contain all that is needed for coming upto date with the latest version of PHP and MySQL. Of course the inclusion of a couple of pages giving a complete project such as a shopping cart application at the end of the book would have imparted a nice touch especially since this book is targeted at beginners too. But that is a minor detail and I guess there are limits to which a books of even this size can cram information. All in all an informative book which gives good value for money.

The author of this book W.Jason Gilmore has developed countless PHP and MySQL applications over the past seven years, and has dozens of articles to his credit on this and other topics pertinent to Internet application development. He has had articles featured in, among others, Linux Magazine and Developer.com, and adopted for use within United Nations and Ford Foundation educational programs. Jason is the author of three books, including most recently the best-selling Beginning PHP and MySQL: From Novice to Professional, and, with coauthor Robert Treat, Beginning PHP and PostgreSQL 8: From Novice to Professional. These days Jason splits his time between running Apress's Open Source program, experimenting with spatially enabled Web applications, and starting more home remodeling projects than he could possibly complete.

Ravi Kumar is passionate about all things related to GPL and open source and likes to share his thoughts through his blog."


You can purchase Beginning PHP and MySQL 5.0 - From Novice to Professional from bn.com. Slashdot welcomes readers' book reviews -- to see your own review here, read the book review guidelines, then visit the submission page.
This discussion has been archived. No new comments can be posted.

Beginning PHP and MySQL 5.0

Comments Filter:
  • Misleading Title (Score:5, Insightful)

    by michaelhood (667393) on Monday May 22, 2006 @02:57PM (#15383167)
    That is a very poor title. Is the book about PHP 5 and MySQL 5? or PHP 5 and MySQL 4?
    • Re:Misleading Title (Score:3, Informative)

      by op12 (830015)
      From this review, it looks like it's version 5.0 for both, which probably explains the title. But it is unclear if that's the case from just the title.
    • by L-Train8 (70991) <`Matthew_Hawk' `at' `hotmail.com'> on Monday May 22, 2006 @03:23PM (#15383380) Homepage Journal
      My version of the book is titled Beginning PHP 5 and MySQL: From Novice to Professional. The title on the Barnes and Noble link says Beginning PHP and MySQL 5: From Novice to Professional, but the cover shown at that same link reads Beginning PHP 5 and MySQL 5: From Novice to Professional. So there is some confusion.
    • The title is also misleading because no book will ever turn you into a professional PHP developer. Someone who is new to programming and reads this book is still likely to make newbie mistakes - mistakes that they would make in ANY programming language.

      Incorrect data validation; Inappropriate use of resources; Inelegant design; Bad debugging methods; Using the wrong tools for the job. All of these and more are things that you really won't learn from a book. You learn these through experience.

      Any book that p
      • The title is also misleading because no book will ever turn you into a professional PHP developer. Someone who is new to programming and reads this book is still likely to make newbie mistakes

        I agree infinitely. No, double that.

        Incorrect data validation; Inappropriate use of resources; Inelegant design; Bad debugging methods; Using the wrong tools for the job. All of these and more are things that you really won't learn from a book. You learn these through experience

        I agree even more than infinitely. M

      • Well of course the title is misleading. It's as misleading as "Sams Teach Yourself C++ In 21 Days!" - The title is nothing more than an attention grabber, and it works rather well too.
      • So maybe this should be "Beginning PHP and MySQL 5.0 (both) - Words to read to begin to Begin" Ok...I know someone will bitch abut something embedded in that title somehow
    • I think you should have IQ points taken away for wasting time, spacing and characters with that comment.
  • LAMP Rocks (Score:3, Interesting)

    by celardore (844933) on Monday May 22, 2006 @03:00PM (#15383190)
    When I was learning programming from the age of 12, I was 'developing' Windows apps, for various purposes. After PHP / MySQL had been about for a while, I picked those up. I dropped any windows development I did - just because it didn't interest me anymore with this exciting thing going on. I would and have suggested to a lot of newcomers to coding that they look into PHP, and a lot of them did with some success.

    You can do some incredible stuff with PHP/MySQL if you put your mind to it. One of my favorite projects (it wasn't the definitive or only one!) was a windows app that hooked keypresses. Every so often it would upload the number of keypresses to some PHP / MySQL code and update your user profile.

    The application potential is impressive, and not fully exploited the way I look at it.
    • Re:LAMP Rocks (Score:5, Insightful)

      by entrylevel (559061) <jaundoh@yahoo.com> on Monday May 22, 2006 @03:43PM (#15383505)
      I prefer the LAMP camp myself, as opposed to the ASP.NET/SQL Server camp, which I assume is what you meant when you compared LAMP to "Windows development".

      However, although I'm the first to brag about the power, simplicity, and performance that PHP and Apache offer when used by the right programmer, I do make a living off of ASP.NET/SQL Server applications, so please consider the following in the ensuing flamewar:

      1. PHP is an extremely flexible scripting lanuage, that really excells at what it does: powering the back-end of a web application and interfacing with databases and the file system. Trying to make PHP do other things is possible, but is almost always a nasty hack.

      2. The .NET Framework and CLR although sometimes misunderstood and often misguided, is really one of the best general purpose development environments bar none right now. It does web applications just as well as it does desktop and console applications. ASP was truly idiotic and horrid, but ASP.NET is very mature and worth an unbiased look if you aren't familiar with it. Then again, there is MSDN documentation and VB programmers, which tend to cancel out anything good I could say about .NET.

      3. Say what you will about SQL Server, but if we could just replace the M in LAMP with PostreSQL, or, well, anything other than MySQL, I would be happy. SQL Server is not my favorite database, but it is very good. MySQL has its niche, but I expect a RDMS to have stored procedures and transactions as standard fare.

      (yes, I know 5.0 has SPs, and InnoDB gives you transactions, but I said "standard fare")

      4. This is the most important point of all: There are just as many cookie-cutter, craptastic, insecure, bug-ridden PHP apps out there as there are ASP.NET apps. On the other hand, if you are smart and creative, and truly use the tools provided by either platform, you can create fantastic applications with either one, just as easily.
      • if we could just replace the M in LAMP with PostreSQL
        I read this once at some Ubuntu message board (my screen saver):

        LAMP: Linux, Apache, Most of our cool scripting languages start with a P and PostgreSQL
      • "ut ASP.NET is very mature and worth an unbiased look if you aren't familiar with it. Then again, there is MSDN documentation and VB programmers, which tend to cancel out anything good I could say about .NET." LOL. VB.net is not your grandpa's VB, son. stop talking out of your ass.
        • I didn't say VB.NET, I said VB programmers and MSDN documentation.

          VB.NET is a fine language, if a tad verbose for my taste.

          My problem is not with the language. My problem is with the swarms of morons churning out God-awful code using said language.
      • Re:LAMP Rocks (Score:5, Insightful)

        by hobuddy (253368) on Monday May 22, 2006 @07:06PM (#15384596)

        PHP is an extremely flexible scripting lanuage, that really excells at what it does: powering the back-end of a web application and interfacing with databases and the file system. Trying to make PHP do other things is possible, but is almost always a nasty hack.

        Help me out here: you're saying that PHP is extremely flexible, as long as the programmer only tries to write one type of program with it? Hmmmm?

        I think we both recognize the truth: compared to Python, Ruby, or Lisp, PHP is not very flexible at all. It's a poorly designed, inflexible language that happens to have gained momentum at a critical era in the history of the WWW.

        • I think we both recognize the truth: compared to Python, Ruby, or Lisp, PHP is not very flexible at all.
          Could you perhaps elaborate on how PHP is inflexible? As far as I know, all four languages are Turing-complete and you can accomplish the exact same things in all of them. Are you including their standard libraries, or what?
        • Maybe after 5 years it's time for you to look at the language again. And you should also take a look at the languages you mentioned - you'll find enough inflexibility in all of them (including PHP). Most of the time is the upgrade issue haunting them. If they'd just drop mistakes they once made they could also just start a new language.
      • Re:LAMP Rocks (Score:3, Insightful)

        by Sentry21 (8183)
        (yes, I know 5.0 has SPs, and InnoDB gives you transactions, but I said "standard fare")

        What does this even mean? You know that they are available, but you don't want to use them? You don't support using the latest versions? You seem to want to imply something, but I can't figure out what it is.
        • My point about MySQL is that many components that people consider to be part of any Relational Database Management System (ACID-compliance, referential integrity, single-level local transactions, and a method to abstract database server logic into methods with parameters), were not design tenets of MySQL. They all feel like an afterthought, and require some effort to get working, instead of being the default.

          As an example, I seem to remember that FOREIGN KEY REFERENCES was silently ignored in MySQL with the
  • by Anonymous Coward
    that tells me how to code PHP. I don't want to learn how to code PHP. I want blocks of code with an explanation of what it does that I can cut and paste into simple webpages that talk to my database. I know how to change variable names using vi, thank you. I don't want to learn this; it will be passe' in a month, dead in a year.

    Whoa, look at the time. Next language/framework/ide please...
  • is it Monty Python themed? Because I read no technical book without a Monty Python theme... as we've seen today, it's the only way to get through that technical mumbo jumbo!
  • I prefer to start out with a fairly simple introductory book and also get a good reference book that assumes you know the language. In the case of PHP, I skipped the reference and just visit php.net.

    A book like the one being reviewed tries to do too much. When you're starting out, you don't want a a lot of detailed library stuff getting in the way. Once you've got the basics done, you don't want a book that teaches it like a course, you want a reference.
  • Similarly MySQL is a free database which is ideal for use as a backend for any website. Any website? Uhhhh, not so much. If that is the summary of the review I wouldn't place too much credence in the rating or subsequent factoids.
    • From the first sentence of the review: Spread over 860 pages and divided into a whooping 37 chapters. Not whopping but whooping. It sounds as if reading over this volume will leave the reader with an infectious disease and annoy their cubicle neighbors to no end.

      Why is it most of these reviews sound like grade school current events reports?

  • by ShakaUVM (157947)
    Wait, I thought Ruby on Rails was the trendy new thing that you can't visit a website without seeing?

    Damn kids these days.
    • Wait, I thought Ruby on Rails was the trendy new thing that you can't visit a website without seeing?

      I think R&R is more common for intranet and B-to-B apps rather than public sites. Thus, you wouldn't see it much browsing around public blogs etc.
             
  • by op12 (830015) on Monday May 22, 2006 @03:11PM (#15383282) Homepage
    Does anyone know how this compares to "PHP and MySQL Web Development [amazon.com]"? It seems like both cover PHP5 and MySQL 5.
    • Welllllll, and this is my own opinion here, but I wouldn't buy either one. There are so many free php/mysql resources, you're pretty much going to be throwing your money away unless you really don't know anything about programming languages or relational databases.

      Php.org has got some great language resources. mySQL.com...eh, not as good, but decent if you have a basic grasp of SQL.
      • When I'm without my books, looking online is a great alternative, but it's a lot easier to say "well, I want to do this," then look up this in the book where everything is clearly and concisely (one would hope) put together.

        I go a lot faster with a good reference book then I do hunting online.
    • I have both. Get the one you linked--the one reviewed is like reading a reference manual. Page after page of function documentation--well, php.net is better for that. Waste of $.
      • PHP.NET? Cool! I didn't realize that Microsoft had done this. Is this the replacement for C#? (before you reply telling me I'm an idiot, it's a joke. yes, I'm talking to you)
        • by Anonymous Coward

          PHP.NET? Cool! I didn't realize that Microsoft had done this. Is this the replacement for C#? (before you reply telling me I'm an idiot, it's a joke. yes, I'm talking to you)

          Not Microsoft, and not a replacement, but it's indeed funny to see a hackish hobby project trash the hell out of PHP's performance even with all the Zend and Roadsend bells and whistles:

          http://www.phpcompiler.net/ [phpcompiler.net]
          http://www.phpcompiler.net/Benchmarks.htm [phpcompiler.net]

          Of course, once you venture into the native VB.NET/C# land, you can expect perform

  • by acreman (745270) on Monday May 22, 2006 @03:13PM (#15383301)
    I personally bought the previous edition of this book. It dealt with PHP 5 and MySQL 4. I learned quite a bit in only a short time. This book helped me finish my capstone project for my engineering degrees. I recommend this book to anyone who is starting off in programming web material and anyone who wants to learn PHP 5 relatively fast. As for MySQL it covers mainly how to connect to a MySQL database using PHP and does not cover in detail how to perform SQL queries.
  • Remember, Windows is the prevalant desktop operating system.

    Examine the options in the tools available to you, pick what works for you.

    I've tried MySQL and PHP and mod-perl and CGI and python, but my current favorites are PostgreSQL [postgresql.org] and Tomcat [apache.org] hosting Java Servlets. No books required, their included documentation is quite good.
  • persistent problem (Score:5, Interesting)

    by b17bmbr (608864) on Monday May 22, 2006 @03:16PM (#15383317)
    The first 21 chapters of the book solely concentrates on PHP where the author explains with the aid of examples how to write good programs in PHP.

    this is a persistent problem with all of these programming in ____________ books. They teach the language and sometimes get around to dealing with good programming. Learning PHP, or java, or python, or whatever is still not learning to program. Learning to program effectively should be the first priority. All the OOP features in PHP5 are of no use to someone without good knowledge of OOP. Likewise, I'd gather that most of the insecurities in PHP are the result of poor design. PHP is great for its templating features, the ability to separate content from design, and its speed of development. But, that still doesn't make it secure or effective. How many times does a programmer get in trouble becasue they don't escape double quotes in a TEXT field in mysql, or account for malformed URL's, html, bad javascript, etc.?

    No matter how good these books are, and I'm sure they do a good job of presenting all of PHP's features and strenghts, they still usually lack teaching how to design a web site/application, how to effectively use passwords, secure data queries, efficient programming, etc. That might be an altogether different beast, but there's a world of difference between using PHP in a web site and writing a good web app. I'd wish that the books would focus more on good programming techniques. I don't imagine everyone will buy the book otherwise, and not everyone will benefit the same, but I've not found too many books that put "programming" ahead of "programming in".
    • Do you (or anyone) have any suggestions for a book that teaches beginning concepts, as you say?

      This isn't idle for me - I want to contribute to a particular open source project (via programming; I currently do testing/documentation/etc.). While I work in IT, my background isn't in IT, and my programming education stopped at CS102, many years ago. I've taught myself plenty of BAD programming in PHP etc., but I'd like someone to suggest a book that teaches "good programming".

      To put it best, I learned my pro
    • PHP is great for its templating features, the ability to separate content from design, and its speed of development.

      Um, sorry, could you show me which language more tightly couples content and design?

      Binding content and design is what those web template languages do. It's why they're better than traditional CGI scripts for quick projects and crash and burn for large projects, unless you add something to manage the separation. That some people have managed to assemble frameworks that do sort of separate cont
    • by Anonymous Coward

      PHP is great for its templating features, the ability to separate content from design, and its speed of development.

      Excuse me?

      If anything, PHP actively promotes spaghetti code. It's PHP, HTML and SQL usually mixed together all over the place. How many times have you seen tr/td elements being output directly to the client from looping through the dataset returned by a query three lines above the table element? Because I've seen it a zillion times, and counting.

      There's only one "official" templating engine,

      • perhaps it's in how you use php for templating. for example, after I design the layout using CSS2 (I never use tables anymore unless it's for data), I insert the applicable files: links.php, content.php, etc. You can do content and design separately in php, and in fact it works quite nicely. One just needs to use it well. That's all. it's the same in say java using a MVC design. In my AP comp sci class we wrote an address book (simple yes, but) we displayed the data singularly in a form (which could
      • Different apps require different magic_quotes and register_globals settings (so we have a ton of different servers - management loves spending money on new machines). The code is unmaintainable.

        Here's a tip for your .htaccess if you're using Apache:

        php_flag register_globals off
        php_flag magic_quotes_gpc off

        I would suggest you at least put together on the same server apps which have to communicate between each other. Then it's probably not worth the time.

  • Well, here is the problem. There is only one chapter on securing PHP and MySQL, and it is the 21st Chapter. Why put anything on the internet if there isn't sercurity on it.
  • by geekschmoe (244913) on Monday May 22, 2006 @03:19PM (#15383340)
    WAMP (windows - apache - mysql - php) server is a cool thing I found if you want a quick and integrated solution to developing with mysql/php on windows systems. It puts a little icon in your dock that is similar to the start menu and you can start/stop all servers and enable/disable php modules, etc. It also comes with phpMyAdmin for managing the mysql databases. It's one big executable with installer and theres no admin stuff to deal with before you start programming. Not that any of the admin stuff is particularly difficult, just extremely annoying considering the frequency of changes to php and apache.

    http://www.en.wampserver.com/ [wampserver.com]
    • What you described sounds very similar to having an XP install with IIS, Visual Studio Express 2005 (VB or C#) and SQL 2005 Express. With that sequence I can be up and running, ready to go in less than 30 minutes.
    • Hey, Windows/Apache/Flat-file-db/Perl also works fine.
      At least for a site with ten hits a day. All of which are from 127.0.0.1.
    • Windows, IIS, SQL Server and PHP. Only downside is SQL Server is expensive to deploy but it sure beats the pathetic excuse for a database that is MySQL.
    • There's another similar project by the name of XAMPP [apachefriends.org]. XAMPP comes with quite a lot of other handy auxiliaries as well, such as eAccelerator, and it's available for Linux, Windows, Solaris and most recently OSX. The interesting thing is it supports both PHP 4 and 5, allowing easy testing of an application on both versions - and at least the Windows version comes with an automagical version switcher. I'd recommend giving both packages a look.

      Do note this, however (and I think it goes for WAMP too):

      The defa

    • There's also MAMP [mamp.info] for the Mac.
  • "Spread over 860 pages and divided into a whooping 37 chapters" I'd prefer a book that does not whoop, especially over the course of 37 chapters.
  • by dada21 (163177) <adam.dada@gmail.com> on Monday May 22, 2006 @03:39PM (#15383479) Homepage Journal
    I've tried so many PHP and MySQL books over the years that I can't even keep track of what I'm reading. Coding just doesn't seem to make sense to me in book form.

    I learned the most I possibly could by downloading Wordpress (blog software), PHPBB (bulletin board software) and setting them up. I downloaded modifications and looked over the code in person.

    Over the past few months I've become really adept at writing my own PHP and MySQL-based software, to the point that I'm starting to design my own CMS interface. Not a single thing I've learned from a book has stuck, but everything I learn in chomping on code in Notepad or emacs seems to stick forever.

    Anyone else have problems with books on coding?
    • Me Too.

      I use books only as a language reference. I find that no matter what I'm trying to accomplish in code, any book I own doesn't have examples that "fit" the pieces of my app that I'm struggling with. So what good is a book with 1000 pages of example codes and 300 pages of theory when 95% of the time it doesn't fit what I need anyways? I prefer the reference style book or snippet archive (TurboPascal days): "a Listbox has these properties, methods, and events and here is how they work" or "To make
  • I learn more by doing and then discovering the effects of what I had done. (Hmmm... fire does that... okay.)

    Seriously though, as a relative n00b in the PHP world, I like the visual quickstart guides by Peachpit Press for PHP and Advanced PHP, where there is a practical example of what you might need to use PHP for, in addiion to a disection of the code being used. Both of these books deal with MySQL as well.

    While I wasn't exactly scripting my own Nuke system in ten minutes, after some casual reading I w
  • > The beauty of PHP is in its open nature and the rich set of libraries and modules which imparts a lot of power and flexibility to the programmer.

    The same could be said for python or perl. I think PHP's main "beauty" feature is how easy it is to install, nothing more.

    • The real beauty is its syntax and lack of explicit type definitions. That change is very logical, and removes a lot of the legwork required to develop (which isn't a bad thing).

      Also, as it's just as easy to install Perl, your argument doesn't hold a lot of water... there must be another reason it's so popular ;)

      • > Also, as it's just as easy to install Perl, your argument doesn't hold a lot of water

        Not mod_perl, it isn't. Well, at least not as easy to just drop in. It's easier these days, but I really think it held mod_perl back years ago.

        As for lack of explicit type definitions ... that of course is nothing that Perl/Python/Ruby doesn't have either. Its syntax I could take or leave ... it seems a bit nicer than Perl in some places (there's only one sigil), but nastier in others (no regex literals or operators
  • by unity100 (970058) * on Monday May 22, 2006 @04:04PM (#15383636) Homepage Journal
    During the years i have been using these, i have come to believe that you can to almost anything with these, except housework.
  • The beauty of PHP (Score:1, Flamebait)

    by Sweetshark (696449)
    The beauty of PHP *head explodes*
    beauty? PHP? Have you every looked at it? closely? Do you know any other solution?
    Just look at the naming of is_null, empty and isset ...
    • Flamebait? Come on moderators, either you know the subject and can moderate or you don't and you shouldn't.

      PHP is the worse language found on the web. The only reason it exists is because its easy. Java/ruby/python make a much better solution than PHP on any platform.

      Enjoy,
  • I use PHP, but I still don't know how to use it use it. The most I know is HTML, which doesn't really count, and Visual Basic. It would really help if I learned how to use PHP myself.
  • Beware. I own this book, and I can tell you it is full of mistakes and inaccuracies. Nuff said.
  • Template systems have of course been around a while, but I must put in a plug for TinyButStrong - http://www.tinybutstrong.com/ [tinybutstrong.com] - here. I've been writing PHP apps for some time but after casting around for a template system a couple of projects back dropped on this one. Absolutly brilliant piece of work and I've recently been combining it quite successfully with xajax - http://www.xajaxproject.org/ [xajaxproject.org]

    I've no connection with either of these two projects, just a very impressed user (and the TinyButStrong promo
  • The beauty of PHP is in its open nature and the rich set of libraries and modules which imparts a lot of power and flexibility to the programmer. I haven't done a PHP install in awhile - is including these additional modules and libraries still as easy as recompiling the whole package, trying to get Apache to accept the recompiled module, then fixing all the scripts that suddenly don't work with the new module?
  • 860 pages about PHP and MySql? It seems like a lot, for what are very simple
    technologies.

    If you are an experienced programmer and want to learn PHP I would recommend
    reading O'Reilly's "PHP in Nutshell" book. You can read through the whole thing
    in less than a day and pick up most of what you will need to know. Also you
    cannot beat the online docs as a reference.
  • A sorry situation (Score:1, Informative)

    by teknico (217206)

    The fact that PHP and MySQL are the most deployed tools for web development is a rather sorry situation, given the deep shortcomings of both tools.

    See these articles about the many PHP warts:

    Experiences of Using PHP in Large Websites [ukuug.org]

    Why PHP sucks [blogspot.com]

    The PHP Ghetto [ianbicking.org]

    You will be happier with a more mature and complete dynamic language like Python, or even (gasp ;-) ) Ruby.

    Similarly, see these other articles about the many MySQL warts:

    MySQL Hate [pythonmac.org]

    MySQL Gotchas [sql-info.de]

    Compare the last one with the one fo

  • "PHP and MySQL use is so prevalent that nowadays it is hard to miss seeing a book review on the front page of Slashdot concerning these technologies."

    There, that's better.
  • by Chacham (981) *
    Oh my, when you people get it? MySQL is NOT a database.

    It doesn't look like a database, it doesn't smell like a database. It's doesn't even taste like a database. And only the really nascent to the db scene would say it looks like a database.

    It happens to have an language interface that on some level partially coincicdes with what many people think SQL should be. But, that's where it starts, and that's where it ends.

    I'm not saying MySQL is a bad product. It's a wonderful product for quick web development an
  • Basically, this (below), plus a litte SQL, and 15 minutes of installation is all you really need to know/do to get very well started - you don't need a book --

    <?php
    $connection = mysql_connect($location,$user,$pass) or die("Couldn't connect to DB server.");
    success_code = @mysql_select_db($db, $connection) or die("Couldn't select database.");
    $sql = "SELECT * FROM $table";
    $result_set = mysql_query( $sql );
    while ($row = mysql_fetch_array( $result_set )) {
    do_something_with( $row );
    }
    ?>

    The only

Sentient plasmoids are a gas.

Working...