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

  • Home
  • SEARCH
  • 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 8117351
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T04:08:23+00:00 2026-06-06T04:08:23+00:00

I have a contact form which asks users for their name, email address and

  • 0

I have a contact form which asks users for their name, email address and message.

The name and email address are stored in Person and the message is stored in Message

Message belongs to Person so when I do:

$this->Person->Message->saveAll($this->request->data)

..the name and email address are INSERTED in the people table and the message is INSERTED in the messages table with a person_id.

So far, so good.

Now, what I want to do is provide a way for Person to be UPDATED and Message to be INSERTED if the user (identified by their email address) comes back and submits a second message.

The only way I have found to do this is to run find on Person to see if there’s a record containing the email address submitted in the form. If there is, I use array_merge to add it to $this->request->data['Person']. This works, but this feels like a bit of a hackish way of doing things.

Is there a more straightforward way of doing this?

  • 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-06T04:08:25+00:00Added an answer on June 6, 2026 at 4:08 am

    After finding your Person, you could just set person_id of your Message und just run save on it, so you don’t have to save the person again.

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

Sidebar

Related Questions

I have a contact form in my flash file with name/email/message fields which a
I have a contact us form, whereby the user enters his name,email address and
I have created a contact form which will email me once sent. Now I
On my client's website (domain.com) we have a contact form which sends an email
I have a contact form on a website (a general form: name , email
I have the following script which creates an email from a contact form: http://codeviewer.org/view/code:1b54
I have contact form which is sending email. But if I type a long
I have this PHP contact form which disallows a submission from an existing IP.
I have an HTML Contact us form which I plant on my client's HTML
i have a contact form sending itself to me by email using ASP classic,

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.