我想使用来自http://www.redbeanphp.com的预打包单文件Redbean 1.3 ORM。当我试图得到一个结果,这样..预包装Redbean只提取一个(最后一个)行
require_once ('redbean/rb.php');
require_once ('config.php');
R::setup('mysql:host='.MYSQL_HOST.';dbname=mydb', MYSQL_USER, MYSQL_PASS);
$test = R::find('function', ' ID < 10 ');
foreach ($test as $val) echo $val->Class.'<br>';
输出如下:
Notice: Undefined index: id in rb.php on line 3686
Notice: Undefined index: id in rb.php on line 3686
Notice: Undefined index: id in rb.php on line 3686
value.of.class.field.from.function.table // << prints only the 9th value
正如你可以看到我只得到即使有条目的最后一行的结果ID 1到xxx。当我将where子句设置为ID < 9
时,我只打印出第8行。
任何想法,为什么?或者任何无配置的红豆的替代品?