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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T22:21:05+00:00 2026-05-11T22:21:05+00:00

I am using CakePHP framework with MySQL database and I have problem in saving

  • 0

I am using CakePHP framework with MySQL database and I have problem in saving one particular value to the database. I have a table called ‘Attributes’ with fields,id,form_id,label,type,size and instructions. When a link is clicked,default values are stored in the table for these fields.

Now I added a new column called ‘required’ to the Attributes table. Its value is either 0 or 1,so I initially created it as a binary field. But the stored in it was \0. So I changed it as integer value and tried to save a default value like 5. but the value stored in it is always 0,i.e.,the value doesn’t change.

It seems silly,but I dont know the reason.I have given the function below. All the other field’s value get stored except for the ‘required’ field. Please someone help me

   function saveFieldEntries($data)
   {    
      $this->data['Attribute']['form_id'] = $this->find('all', array(
                                    'fields' => array('Form.id'),
                                    'order' => 'Form.id DESC'
                                     ));
        $this->data['Attribute']['form_id']=$this->data['Attribute']['form_id'][0]['Form']['id'];

        $this->data['Attribute']['label']= 'Label';
        $this->data['Attribute']['size']='50';
        $this->data['Attribute']['instructions']='Fill it';
        $this->data['Attribute']['type']=$data['Attribute']['type'];
        $this->data['Attribute']['sequence_no'] = $data['Attribute']['sequence_no'];
        $this->data['Attribute']['required']='5';
        $this->Attribute->save($this->data);
}
  • 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-05-11T22:21:05+00:00Added an answer on May 11, 2026 at 10:21 pm

    At a glance, your code looks fine. Is it possible you’ve got a cached version of the model so CakePHP still assumes the field’s type is binary?

    Try deleting the content of the /app/tmp/cache/models directory.

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

Sidebar

Ask A Question

Stats

  • Questions 154k
  • Answers 154k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer From within Access can you open your linked table, tblUsersSubjects,… May 12, 2026 at 10:33 am
  • Editorial Team
    Editorial Team added an answer Don't reinvent the wheel. Doing authentication right is much more… May 12, 2026 at 10:33 am
  • Editorial Team
    Editorial Team added an answer theyre actually called snippets and you can create your own.… May 12, 2026 at 10:33 am

Related Questions

I am using FCKEditor with CakePHP and when I save data sent from the
I am using cakephp framework to build my application. I want that, whenever a
I want to run a web application on php and mysql, using the CakePHP
I am working on a website build using cakephp framework. My problem is that

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.