Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds
Arrow up icon
GO TO TOP
Learning PHP Data Objects

You're reading from   Learning PHP Data Objects A Beginner's Guide to PHP Data Objects, Database Connection Abstraction Library for PHP 5

Arrow left icon
Product type Paperback
Published in Aug 2007
Publisher Packt
ISBN-13 9781847192660
Length 188 pages
Edition 1st Edition
Languages
Arrow right icon
Author (1):
Arrow left icon
Dennis Popel Dennis Popel
Author Profile Icon Dennis Popel
Dennis Popel
Arrow right icon
View More author details
Toc

Chapter 3. Error Handling

Now that we have built our first application that uses PDO, we will take a closer look at an important aspect of user-friendly web applications—error handling. Not only does it inform the user about an error condition, it also limits the damage if an error is not detected when it occurred.

Most web applications have rather simple error handling strategy. When an error occurs, the script terminates and an error page is presented. The error should be logged in the error log, and the developers or maintainers should check the logs periodically. The most common sources of errors in database-driven web applications are the following:

  • Server software failure or overload such as the famous "too many connections" error

  • Inappropriate configuration of the application, which may happen when we use an incorrect connection string, a rather common mistake when an application is moved from one host to another

  • Improper validation of user input, which may lead to malformed SQL and...

lock icon The rest of the chapter is locked
CONTINUE READING
83
Tech Concepts
36
Programming languages
73
Tech Tools
Icon Unlimited access to the largest independent learning library in tech of over 8,000 expert-authored tech books and videos.
Icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Icon 50+ new titles added per month and exclusive early access to books as they are being written.
Learning PHP Data Objects
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Modal Close icon
Modal Close icon