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 2. Using PHP Data Objects: First Steps

In the previous chapter, we had a brief overview of what PDO is, how to connect to your favourite database using PDO, how to issue simple queries and how to handle errors. Now that you are convinced that PDO is a good thing and are thinking of using it actively, we will be delving into all the features it has to offer.

In this chapter, we will look more closely at creating connections to a database using PDO and connection strings (data source names), the PDOStatement class, and how to traverse result sets. We will also create a small library management application, which will allow us to manage a collection of books of your home library. The application will be able to list books and authors as well as add and edit them.

We will start by having a look at connection strings, since without them, we will not be able to connect to any database. We will then create a sample database, on which all the examples in this book will be based.

We will depart...

Visually different images
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
You have been reading a chapter from
Learning PHP Data Objects
Published in: Aug 2007
Publisher: Packt
ISBN-13: 9781847192660
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