Jump to content

R::associate with redbean and php


loftusp

Recommended Posts

I have created a basic website which allows users to login and then need to record their location. I have it so they enter their location into a form, but I need to associate the table for users with locations.

I used the code:

 

$user = R::findOne('person', 'username=?', array($_SESSION['name']));

$plc = R::dispense('location');

$plc->location = $_REQUEST['location'];

$plc->activity = $_REQUEST['activity'];

$id = R::store($plc);

R::associate($user, $plc );

 

It returns the error:

 

Catchable fatal error: Argument 1 passed to R::associate() must be an instance of RedBean_OODBBean, boolean given

 

 

HELP???!!!! :confused: :confused: :confused::shrug: :shrug: :shrug:

Link to comment
https://forums.phpfreaks.com/topic/236105-rassociate-with-redbean-and-php/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.