Articles tagged PostgreSQL

PHP A to ZCE: Databases and SQL

Databases are an extremely useful tool in web development as they allow you to store data about users, customers, e-commerce products and orders, or anything else. In this article I will cover the basics of using databases in PHP, including how to manage data using SQL.

Managing Your Data With DatabaseObject

DatabaseObject is a class I wrote three or four years ago, as a way of easily manipulating database data. It is not a replacement for a database abstraction class. In fact, it works very nicely with a database abstraction class, however, the version we have provided uses the native PHP PostgreSQL and MySQL database calls.

Understanding Transactions And Locking In PostgreSQL

In most modern relational databases there is support for concurrent operations. PostgreSQL is no different. While concurrency can drastically improve the performance of your application it also has many different implications to thread safety. For those of you who are not familiar with thread safety in general terms; thread safety is the process of ensuring that two threads cannot do the same operation at the same time. The following article discusses transaction control and table locking in PostgreSQL and is intended for an advanced audience.

Implementing An N-Level Nested Tree In PHP And PostgreSQL Appendix

Since creating the second part of the Nested Tree series, I've done further work on the nested tree class. This appendix article is not officially part of the "3 part series", but it is an addon article which may be continually updated with new ideas and snippets to include in the Nested Tree class. The reason these have been kept separate is because they are not core to the concept of implementing nested trees in your web site.

Implementing An N-Level Nested Tree In PHP And PostgreSQL, Part 2

This series of articles is about implementing a nested tree using PHP and PostgreSQL. This article - part 2 - covers the implementation of managing nested trees in PHP. The data we learned how to store in SQL in part 1 must be extracted somehow. In this article, we will create a class used to extract data from the tree and to rebuild the tree. Each portion of the class will be developed separately, then all combined into a single class.

Implementing An N-Level Nested Tree In PHP And PostgreSQL, Part 1

This series of articles is about implementing a nested tree using PHP and PostgreSQL. The theory and code in these articles also applies to MySQL, not just PostgreSQL. An N-Level nested tree is a way to represent hierarchical data, such as a list of directories and files in your operating system, or the listings in a directory such as the Open Directory Project. There can be any number of levels and any number of elements within each level. The goal is to be able lookup data in the tree as quickly as possible with minimal strain on resources. We will implementing this using the nested tree model by Joe Celko.

Migrating From MySQL To PostgreSQL In PHP

This article is aimed primarily at MySQL users, showing them how to start with the PostgreSQL database management system. The article covers just a small number of areas, directly related to use in PHP - it barely even touches on most of PostgreSQL's other features.