Multidim

Package:
Multidim
Summary:
Manipulate multidimensional arrays in MySQL tables
Groups:
Data types, Databases, PHP 5
Author:
troy knapp
Description:
Have you ever wished you could deal with tables instead of multidimensional arrays, but didn't want the overhead associated with creating tables, populating them etc? This class is meant to be a simple alternative to using large associative data arrays. Elements are just as easy to add into temporary tables as they are to put into arrays, they are just as easy to get back out again... and MUCH easier to unset, filter and sort.

This class works by using an "array like" syntax (so it's easy to remember) and creates MySQL tables in memory. Basic functionality that you would expect to have when dealing with arrays is provided (in fact, you'll notice a striking similarity to what the methods "md_push" and "md_asort" do and their cousins do), but it leverages MySQL's ability to sort filter and delete etc. to simplify dealing with complex arrays. It also provides a wrapper method that allows the user to run their own SQL queries on the table (without having to worry about database connections or what the temporary table's name is).


Powered by Gewgley