【发布时间】:2011-04-14 12:11:22
【问题描述】:
我想使用来自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 的任何无配置替代品?
【问题讨论】: