Page 1 of 1

SQL-type queries on PHP Arrays?

Posted: Sat Oct 17, 2009 6:47 pm
by PaulK
I'm using a framework that provides data in large numerically indexed arrays of associative arrays that map field names to values -- essentially analogous to an ordinary SQL table.

I would like to search & return subsets of these in-memory "tables" with the flexibility one would have with SQL. I could develop this basic functionality, but it occurred to me this must be something obvious & useful, and it would be great to find something already existing. Maybe SQLite could support something like that? Or maybe other 3rd party libraries? It doesn't have to be SQL syntax in particular, that just seems an obvious choice. Any library supporting that functionality would do.

Someone else on devshed pointed me to http://absynthe.is.free.fr/sql4array/, but that doesn't seem quite ready for prime-time.

If anyone knows of anything like that or has some tips for how to return subsets of arrays based on specific criteria, I would be very grateful.

Thanks