我想使用來自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行。
任何想法,爲什麼?或者任何無配置的紅豆的替代品?