Object Query Language optimization

From: Date: Sat, 21 May 2011 14:56:18 +0000
Subject: Object Query Language optimization
Groups: php.general 
Request: Send a blank email to php-general+get-313031@lists.php.net to get a copy of this message
hi folks, I'm writing an Object Query Language which is pretty simple, you do request such as *SELECT e.*,c.firstName * *FROM employee e * *JOIN contact c ON e* *WHERE e.id=*? (queries don't get much more complicated than that, you have multiple alias.fieldName in the select, then multiple joins) I'm trying to find the best way to get all the informations. At the moment I am doing a preg_match that simply verify that the whole syntax is good , but to separate all the information i have to separate the query in sub parts (select, from , join, where) and do a preg_match_all on them. So my questions are : - is there a better way to do this? - about regular expression : (that would directly solve my problem) if you do preg_match('!(([a-z])+)!','abcabc',$matches); echo '<pre>';print_r($matches);echo '</pre>'; you get only the last letter, is there a way to get all of them ??? (using a regular expression and only preg_match, no preg_match_all) http://www.regular-expressions.info/captureall.html Regards, JB

« previous php.general (#313031) next »