PhpRiot
Articles tagged MySQL

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.

Storing Images in MySQL Revisited

This article shows you how you can store images in MySQL using the Blob column type. I will show you to create a file upload form, then store the uploaded file in the database. The concepts covered in this article can apply to all files in general, not just images. This is an updated version of a similar article that already appears on PhpRiot.

Eight Weeks of Prototype: Week 8, A Complete Prototype Example

So far in this series, "Eight Weeks of Prototype," I have shown you some of the extensive features the Prototype JavaScript framework provides. In this, the final article of the series, I will bring many of these features together into a simple example.

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.

Storing Images In MySQL

This article is an introduction to using the blob column type in MySQL. The concept is introduced by familiarising users with uploading and storing images in a MySQL table.

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.