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 8055909
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T08:32:41+00:00 2026-06-05T08:32:41+00:00

I have a table named user. The id is generated on the fly. I

  • 0

I have a table named user. The id is generated on the fly.

I have a HABTM table. I am trying to insert a record during the user registration. For some reason I can’t get the user’s id and the user_id to match.

This looks correct, even my array reflects the right information, but the actual data stored is not right.

code:

$this->request->data['User']['id'] = String::uuid();
$this->request->data['Company']['Company'][0]['user_id'] = $this->request->data['User']['id'];

returned array:

Array
(
[User] => Array
    (
        [email_address] => asdf@asdf.com
        [id] => 4fc9a939-3e24-4c79-85d1-6c28e4ca782d
    )

[Company] => Array
    (
        [Company] => Array
            (
                [0] => Array
                    (
                        [id] => 4fc9a939-1840-4c1b-8bd2-6c28e4ca782d
                        [company_id] => 4fc990dd-edb0-4559-bb7b-6a00e4ca782d
                        [user_id] => 4fc9a939-3e24-4c79-85d1-6c28e4ca782d
                    )

            )

    )

)

So it appears that it would work based on the array I got, but it doesn’t save like that. Help is much appreciated.

  • 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-05T08:32:43+00:00Added an answer on June 5, 2026 at 8:32 am

    Maybe because cake autogenerates id to UUID (when field is string and length is 36) take a look at CakePHP API – Model->save()

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

Sidebar

Related Questions

I have a table named users and each row (user) has an image. The
I have a table generated from some PHP code that lists a SMALL amount
I have an User entity: @Entity @Table(name = user) public class User implements Serializable{
I have table with Names such as JS Engineering Services$Web User Setup Header and
I have 2 classes @Entity @Table(name = user) public class User @Id @Column(name =
I have a role table with user name and role and company. I want
I have the MySQL table with 2 rows that is name for user name
I have a table User which has the fields (id, first_name, middle_name, last_name). I
I have a user table 'users' that has fields like: id first_name last_name ...
I have database structure as User Table(user id, username, first name,last name) Event Table(event

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.