0

I want problem with any tables when 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

I use Redbean 3.4

Alexd2
  • 1,044
  • 2
  • 15
  • 28
  • Possible duplicates : http://stackoverflow.com/questions/5663020/pre-packaged-redbean-fetches-only-one-last-row/21948684#21948684 and there you can also find my answer as well. Hope this will help.:) – kta Feb 22 '14 at 02:11

1 Answers1

3

in RedBeanPHP every table in the DB needs to have a primary key column named 'id' - if you don't have that then you need to access the table through a DB view that remaps the primary key column to be 'id'.

The error you are getting from the call to R::find() is telling you that the table does not have a column named 'id'...

jester66
  • 242
  • 2
  • 10