针对数组的SQL查询?

时间:2012-08-09 12:26:02

标签: php arrays

是否有任何类型的php库来执行针对数组的SQL查询?

这样的事情:

$array = array(
    array(
        "field_a" => "first_a"      
        "field_b" => "something"        
    ),
    array(
        "field_a" => "second_a"     
        "field_b" => "else"     
    ),
    array(
        "field_a" => "third_a"      
        "field_b" => "something"        
    )
);

$rows = arrayQuery($array, "SELECT field_a WHERE field_b = 'something'");

/*
$rows = array(
    array(
        "field_a" => "first_a"      
    ),
    array(
        "field_a" => "third_a"      
    )
);
 */

找到类似的内容:http://blog.phpdeveloper.org/?p=61,但这不是查询。

1 个答案:

答案 0 :(得分:2)

我相信LINQ for PHP可以解决问题。我认为这是一个接近因为它在PHP中“查询数组”。