我想使用来自http://www.redbeanphp.com的预打包单文件 Redbean 1.3 ORM 。当我尝试以这种方式获得结果时..
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 行。
有什么想法,为什么?还是redbean的任何无配置替代品?