2013-08-23 31 views
0

我想在編號爲id時遇到問題。redbean 3.4未定義索引:編號

#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 

我用紅豆3.4

+0

任何答案,幫助我嗎? – Alexd2

+0

可能的重複:http://stackoverflow.com/questions/5663020/pre-packaged-redbean-fetches-only-one-last-row/21948684#21948684在那裏你也可以找到我的答案。希望這會有所幫助。:) – kta

回答

2

在RedBeanPHP在DB的每個表都需要有一個名爲「身份證」的主鍵列 - 如果你沒有這樣的,那麼你需要通過一個訪問表將主鍵列重新映射爲'id'的DB視圖。

你是從電話獲取到R::find()錯誤是告訴你的是,表中沒有名爲「身份證」列...