I dont understand why I am not able to update a field on the database based on the following code:
$this->User->id = 1;
$this->User->saveField('image','img/default_pic.png');
Basically, I want to change the current image in the Db with a new one.
The code above just clears the value that is currently in the image field, but does not add anything.
As an example, this is what happens:
id username image
=============================
1 admin mypic.jpg
2 john johnPic.jpg
After the code above is executed I get the following result
id username image
=============================
1 admin
2 john johnPic.jpg
I am confused at what is actually happening
SOLVED!
I decided to go back and check on my
user.phpmodel class and realized that I had attempted to useMeioUploadbefore and gave up, but I never removed thevar actsAsentry.As soon as I commented it out, I am now able to upload pictures.
For anyone else that might come across this issue,
beforeSavemight also caused these kind of problems, according to the following blog: http://blog.phplabs.net/2011/11/cakephp-savefield-not-working.htmlThanks,