Hello,
After performing a save() on a file form, I use the last inserted ID
( $this->Model->id ) to create a correct $filename ( my
moveUploadedFile() returns the correct $filename ) and then I try to
update the 'file' field via $this->Model->saveField( 'file' ,
$filename ). The query runs fine and updates the correct entry...
However... the value in the UPDATE query consists of just one letter!
The first letter of the variable $filename, in my case, as my
webserver is in C:\wamp\ ...., it updates the value to just 'C' !!!!
Here's the code:
if ($this->Banner->save( $this->data )) {
if ($filename = $this->Banner->moveUploadedFile()) {
if ($this->Banner->saveField( 'file' , $filename )) {
debug($filename);
}}}
debug($filename) gives the correct value:
C:\wamp\www\dev\project\app\webroot\files\banner_11.jpg
However the SQL code that runs is the following:
20 UPDATE `banners` SET `file` = 'C' WHERE `banners`.`id` = 2
Is this a bug? Am I doing something terribly wrong?
Any help would be greatly appreciated.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---