SQL-type queries on PHP Arrays?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
PaulK
Forum Newbie
Posts: 5
Joined: Mon Apr 14, 2008 9:50 pm

SQL-type queries on PHP Arrays?

Post 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
Post Reply