Re: SQL like processing on array of keyed arrays ?

From: Date: Wed, 21 Apr 2004 22:30:33 +0000
Subject: Re: SQL like processing on array of keyed arrays ?
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-184164@lists.php.net to get a copy of this message
Richard A. Devenezia wrote:
Suppose I don't have access to a database server. I have any indexed array of like keyed arrays, essentially mimicing a database table. Are there any libraries or functions that I can use to 'query' the array in a SQL like manner ? e.g. $data = array (array(a=>1,b=>2,c=>3) ,array(a=>2,b=>3,c=>4) ,array(a=>3,b=>4,c=>5) );
I think foreach is about the only thing you can do here. If your issue is memory storage then you might consider using SQLite, never used it myself but I hear it's quite small and pretty fast. Well I did think of one other possibility... if you really don't have a database option then you might structure your data into an xml file and then use XPath (I think PHP 5 only) to do queries like that. But a database would be better suited for this task.

« previous php.general (#184164) next »