Jump to content

loftusp

New Members
  • Posts

    7
  • Joined

  • Last visited

    Never

Everything posted by loftusp

  1. Also this is how the data is stored: case 'location' : if ($_POST['location'] && $_POST['activity']) { $pld = R::dispense('locations'); $pld->location = $_REQUEST['location']; $pld->activity = $_REQUEST['activity']; $id=R::store($pld); R::associate($_SESSION['name'], $pld); $vals['location'] = R::related ($_SESSION['name'], 'locations'); $tpl='loggedin.twig'; }else { echo "no user!"; $tpl='loggedin.twig'; } break;
  2. Sorry I'm really not good at this. Basically my table is called locations into which a user adds their location and activity. This is then linked to a user in a person_location table. This is the delete code I have created. Not sure how good it is. case 'delete' : $id = isset($_REQUEST['id']) ? $_REQUEST['id'] : ''; if (!$id) { echo 'No Location identified!'; } else { $currentLocation = R::findOne('location', 'id=?', array($id)); $pps = R::findOne('person', 'name=?', array($_SESSION['name'])); // Why is this not deleting it from the database??? R::unassociate($_SESSION['name'], $currentLocation); R::trash($currentLocation); } $tpl = 'loggedin.twig'; break; Using that detail what would the . $row['id'] . be??
  3. Yes I think so. I have the code written to delete the database entries but I don't know how to make the links! Thanks!
  4. Manually entering data into a form which is transferred into a database. These are then given an id, so I need to pass an id into my php (at least i think i do ) http://homepages.cs.ncl.ac.uk/p.a.loftus/csc2511/ I'm don't know a great amount so here is the site ^^
  5. My code reads: <a href="index.php?action=delete&id=" >Delete</a> How do i change it so the id=1,2,3 etc with each link??
  6. 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: :shrug:
×
×
  • 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.