Summary

In this hour, you learned how to use PHP’s powerful DBA functions to store and retrieve data. You learned how to use dba_open() to acquire a DBA resource, which you can use with other DBA functions. You also learned how to add data to a database with dba_insert(), alter it with dba_replace(), and delete it with dba_delete(). You learned how to use dba_fetch() to retrieve data and how to use serialize() and unserialize() to save complex data structures to a database. Finally, you worked through an example that uses many of the techniques we have examined.

The DBA functions are useful for storing relatively small amounts of data that need to be queried only in a simple way. Inevitably, your needs will occasionally be more demanding than ...

Get Sams Teach Yourself PHP in 24 Hours, Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.