当id为时,我希望任何表都有问题
#MYTABLE publireportaje
idxx - name - last
#THE CODE
R::setup('mysql:host=localhost;dbname=demo','root','xxxxx');
R::freeze(true);
$data = R::find('publireportaje');
echo '<pre>';
print_r($data);
#THE OUTPUT
Notice: Undefined index: id in /home/xxxx/public_html/sandbox/redbean/rb.php on line 4057
Only show the last row
我使用Redbean3.4
在RedBeanHP中,数据库中的每个表都需要有一个名为"id"的主键列-如果没有,则需要通过将主键列重新映射为"id’的数据库视图访问该表。
从对R::find()
的调用中得到的错误告诉您表没有名为"id"的列。。。