i agree. but whay is it generating "WHERE `id` IN (21)" instead of
"WHERE `id` = `21`"? is it something to do with my model? there are
some belongsTo and hasMany interactions. could that be messing with
this if i have not set them up correctly?
On Feb 20, 4:52 pm, "Siebren Bakker" <[EMAIL PROTECTED]> wrote:
> Not exactly sure about this, but shouldn't the SQL UPDATE statement be:
> UPDATE `lightboxes` SET `status` = 'saved' WHERE `id` = `21`
>
> instead of:
> UPDATE `lightboxes` SET `status` = 'saved' WHERE `id` IN (21)
>
> I'm not an SQL guru, so feel free to correct me if I'm wrong here. If that
> is the correct format though, according to the SQL dump, it should have
> updated the database correctly to set the 'status' field to be equal to
> 'saved'
>
>
>
> On Wed, Feb 20, 2008 at 11:53 AM, geordie <[EMAIL PROTECTED]> wrote:
>
> > please help. probably a stupid error, but i'm having a hard time
> > figuring out why my saveField() call does not "stick." i'm relatively
> > new to this so could be a newb problem.
>
> > in lightboxes_controller i have the following lines of code...
>
> > $this->Lightbox->id = $id;
> > if($this->Lightbox->saveField('status', $status))
> > {
> > $this->set('worked', "worked");
> > }
> > else
> > {
> > $this->set('worked', "did not work");
> > }
>
> > $this->set('data', $this->Lightbox->find("
> > Lightbox.id = '$id'"));
>
> > the view just prints out $worked and $data to see what happened. from
> > that output i would claim success. i get a "worked" and an array of
> > data that shows the modified field. see here...
>
> > worked
>
> > Array
> > (
> > [Lightbox] => Array
> > (
> > [id] => 21
> > [user_id] => 1
> > [name] => 264201014
> > [date_saved] => 2008-02-20
> > [status] => saved
> > )
>
> > [Customer] => Array
> > (
> > [id] => 1
> > [first_name] => geordie
> > [last_name] => speake
> > [log_name] => gspeake
> > [email] => [EMAIL PROTECTED]
> > [phone] => 805xxxxxxx
> > [pswd] => pass
> > [is_admin] => 1
> > [is_customer] => 1
> > [is_photog] => 1
> > )
>
> > [LightboxImage] => Array
> > (
> > [0] => Array
> > (
> > [id] => 29
> > [image_id] => 123
> > [lightbox_id] => 21
> > [price_id] => 10
> > [quantity] => 1
> > )
>
> > )
>
> > )
>
> > i have DEBUG = 2 and i see the following...
>
> > SELECT COUNT(id) AS count FROM `lightboxes` WHERE `id` = 21
>
> > SELECT COUNT(id) AS count FROM `lightboxes` WHERE `id` = 21
>
> > UPDATE `lightboxes` SET `status` = 'saved' WHERE `id` IN (21)
>
> > SELECT `Lightbox`.`id`, `Lightbox`.`user_id`, `Lightbox`.`name`,
> > `Lightbox`.`date_saved`, `Lightbox`.`status`, `Customer`.`id`,
> > `Customer`.`first_name`, `Customer`.`last_name`,
> > `Customer`.`log_name`, `Customer`.`email`, `Customer`.`phone`,
> > `Customer`.`pswd`, `Customer`.`is_admin`, `Customer`.`is_customer`,
> > `Customer`.`is_photog` FROM `lightboxes` AS `Lightbox` LEFT JOIN
> > `users` AS `Customer` ON (`Lightbox`.`user_id` = `Customer`.`id`)
> > WHERE `Lightbox`.`id` = '21' LIMIT 1
>
> > SELECT `LightboxImage`.`id`, `LightboxImage`.`image_id`,
> > `LightboxImage`.`lightbox_id`, `LightboxImage`.`price_id`,
> > `LightboxImage`.`quantity` FROM `lightbox_images` AS `LightboxImage`
> > WHERE `LightboxImage`.`lightbox_id` IN (21)
>
> > now for the problem...
>
> > the table has been changed, but it now shows the field i was trying to
> > change has been changed to the name of page's icon (sp2.ico).
> > subsequent attempts to change the field give the same output in all
> > responses, but i always get "sp2.ico" as the text in the field.
>
> > what am i doing wrong?
>
> > hope that wasn't too wordy. thought it better to include the code and
> > outputs from the start before being asked.
>
> > thanks.
>
> --
> In the name of Life, Liberty, and the pursuit of my sanity.
> Siebren Bakker(Aevum Decessus)
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake
PHP" 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
-~----------~----~----~----~------~----~------~--~---