O'Reilly logo

Sams Teach Yourself CGI in 24 Hours, Second Edition by Rafe Colburn

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

File Operations

Before I go into a specific example of an application, let me explain how accessing a flat-file database works in general. There are four operations that you might want to perform—reading a record, adding a record, deleting a record, and modifying a record. Let’s look at the steps required to perform each of these operations.

Retrieving Records from a Database

1.
Find some information that will allow you to identify the record or records you need to retrieve.
2.
Open the file in which the data is stored.
3.
Search through all the records in the file until you find the ones that match the information you’re looking for.
4.
Copy the data from the file into a data structure that can be accessed from within your program.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required