Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8023223
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T22:30:18+00:00 2026-06-04T22:30:18+00:00

I’m trying to create a social networking type of website where a user can

  • 0

I’m trying to create a social networking type of website where a user can send/receive a friend request. In our current system when a user sends a request half the required information is stored in the database then when a user accepts the rest of the information for the rest is inputted.

the relationships_users table is id, partyone, partytwo, expirydate, active

the problem im having is once a user accepts a request and puts in an expiry date, its inserted in a new column – not in the column relating to that user

here is my add function

    if($this->request->is('post')){
    $this->Relationship->create(); 
    if ($this->Relationship->save($this->request->data)) 
    { 
        $this->Session->setFlash('The relationship has been saved');  

    }
    else { $this->Session->setFlash('The relationship could not be saved. Please, try again.'); } 
    } 

  }

here is my approve function

if($this->request->is('post')){
        $this->Relationship->create(); 
        $this->Relationship->save($this->request->data);
        $this->Session->setFlash('The information has been saved');}
        else{$this->Session->setFlash('The information couldnt be saved');}

im assuming I’ve missed some simple code, any help would be appreciated
its inserted in a new column – not in the column relating to that users relationship*

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T22:30:19+00:00Added an answer on June 4, 2026 at 10:30 pm

    Your post doesn’t the problem at whole, but what I understand you should follow some steps described below:

    • When first half of the info saved in Relationship table then you have to get the id of that entry and you can get like following:

      $this->Relationship->save($this->request->data);

      $lastId = $this->Relationship->id; // will gives you id of first half info saved

    • Then you have to embed that $lastId with the rest of the info i.e last half after request confirmation. If you can embed that ID to the second half info that is within $this->request->data, then $this->Relationship->save($this->request->data) will update the previous saved row. In that case, you don’t need $this->Relationship->create();.

      According to cakePHP, if any data contains id within it, then instead of creating new row and save, it will update the corresponding row having that id.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Basically, what I'm trying to create is a page of div tags, each has
I'm trying to create an if statement in PHP that prevents a single post
I am trying to understand how to use SyndicationItem to display feed which is
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I used javascript for loading a picture on my website depending on which small
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I am trying to render a haml file in a javascript response like so:
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
We're building an app, our first using Rails 3, and we're having to build

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.