PHP中的SQL解析器? [英] SQL parser in PHP?
问题描述
UPD :管理员更改了标题,我找到了解决方法: http://code.google.com/p/php-sql-parser/
UPD: Admin changed the title and I've found the solution: http://code.google.com/p/php-sql-parser/
我正在尝试将SQL查询转换为php数组.
I'm trying to convent sql query to php array.
例如: 从tbl_name中选择col_name,而col_name> 0;
必须返回以下内容:
array(
'table' => 'tbl_name',
'value' => array('col_name'),
'where' => array('col_name > 0')
);
我发现了此. mb,您知道更好的解决方案吗?
I've found this. Mb you know any better solution?
推荐答案
有几个软件包可用于此任务:
There are several packages that are available for this task:
梨: http://pear.php.net/package/SQL_Parser (仍然很新)
txtSQL : http://sourceforge.net/projects/txtsql
PHP-SQL-Parse : http://code.google.com /p/php-sql-parser/(如OP所述).这似乎是这三者中最强大的(当然是记录最好的)
PHP-SQL-Parse: http://code.google.com/p/php-sql-parser/ (as mentioned by the OP). This seems to be the most robust of these three (certainly the best documented)
这篇关于PHP中的SQL解析器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!