new column in database doesn't recive data from form cakephp - cakephp

I had a working form in CakePhp 2.X. I added a new column of type varchar in the mysql database and updated correctly from in the view. When I submit the form, old inputs are saving correctly but the new column is not. I tried in the cake php controller to match the data:
$data['table']['newcolumn']
but it doesn't work. Where is my mistake?

clear your cache files, Cakephp creates model cache in
app/tmp/cache/model
You need to delete cache for that particular model

Related

CakePHP save associated model data in afterSave

I have a Task model and project model, tasks belongTo a project, what i wish to do is on the afterSave in the task model, update a field in the project model, but im having trouble i've tried using $this->Task->Project->Find(), with no joy. thanks.
You're probably looking for saveAll().
http://book.cakephp.org/2.0/en/models/saving-your-data.html#model-saveall-array-data-null-array-options-array
Side note: why would you expect 'find()' to save your data?

Drupal webform submission creating new table

I have created a webform. However I want that whenever I create a new webform and if I input some data and submit it, It must create new table in phpmyadmin for every new form that I create.
By default every submitted data goes to "webform_submitted_data" table. I want every webform that I create must have separate table.
Please give me steps on how to do that.
If you use the webform module as is, it will use its own database table structure exactly as you describe.
If you have particular requirements on how the data of your webforms is stored in the backend, you'll have to create your own custom module that either builds its own forms and does the data storing itself or that hooks into the existing webform functionality and changes just the storing and retrieving part of it.
In either case, it'll be a bit of work on your part to build that custom module.
How the data is stored isn't something you can just configure for the webform module... :-)
However, I'm not sure why you want to change the way the data is stored, but you're aware that you can export the submissions data as csv and other file formats to manipulate later, right?
The webforms mysql view module will give you a pseudo-table for each webform, allowing read access to the data.

How to stop Wordpress from saving custom post types to wp_posts

I want to have a custom table in the database called 'Products'. The user will be able to add/edit/delete products using the back end interface. All updates and changes will be made to this 'Products' table. I tried doing this in Wordpress using custom post types. I created a 'Product' custom post type and then a plugin to detect when a post is published. However, custom post types will automatically save all posts to the database wp_posts, which is not what I want. In doing this, i will be having duplicate information.
Is there a way to stop wordpress from saving this to wp_posts? Or is it not advisable, which in other words means Wordpress isn't the right CMS for what I'm trying to do?
Thanks!

The newly added field's value not saved in db by magento

In Magento I created a new module as like the customer module.
Everything will be fine.
In my module there are some additional fields, but the values are not being saved into the db.
Only particular fields save into db.
I have not created a setup file as in the core part.
Do I require a setup file? And if yes how may I do it please?
How to set the default entities.
delete cache .
And if problem exists.Refer Link 1.Hope this helps you.

CakePHP Ajax form - cloning form fields

Using cake 2.2. I currently have a form (built using the form helper) that allows users to add expense claims. Each claim consists of many expenses. So the form contains a row for each expense along with a button that uses jQuery to clone the first row of fields and insert them (with incremented ids/names). The problem is when the form is submitted and there is an error, the cloned fields disappears as the page refreshes (I guess because their not in the dom any more).
The values are still in $this->data so I guess I could manually rebuild them but if I made the form submit by ajax would it solve the problem? IE on error the cloned fields would still remain?
Thanks in advance
Things that are built from Javascript will not retain from one page-load to the next.
Either use Ajax (probably ideal), or build out the fields with PHP based on the supplied data.
Either way is fairly "normal" way of doing it.

Resources