Saturday, February 2, 2013

Re: sql statement Cake 1.3 uses to add data

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi Jonathan,


thanks for the answer. That post you found is a good one.
But I try your code snippet I get with the debug the output 1 being a
boolean true.
The same with all variations of true and false in the parameters.
I don't know what this does, but not what I intended.
Also no further information to find in
tail -f /var/www/myapp/tmp/logs/debug.log
tail -f /var/www/myapp/tmp/logs/error.log

When I try the mentioned method in the post for the app_model I get as
last request a select statement searching for the slug I implemented.
Strange.... maybe something is broken with the sluggable behavior.

Calamity Jane


Am 02.02.2013 20:14, schrieb Jonathan Sundquist:
> Alright after a bit more research, with debug level set at 2 run this after
> your query.
>
> $log = $this->b->a->getDataSource()->log(false,false);
> debug($log);
>
> Reference for the above is coming from here:
> http://stackoverflow.com/questions/3647065/how-can-i-see-cakephps-sql-dump-in-the-controller
>
>
> On Sat, Feb 2, 2013 at 1:03 PM, Anja Liebermann <cake@anjaliebermann.de>wrote:
>
> Hi Jonathan,
>
> debug 2 ( or also 3) only shows me the SELECT statements, but not the
> INSERT statements.
>
>
> Calamity Jane
>
>
> Am 02.02.2013 20:01, schrieb Jonathan Sundquist:
>>>> You should be able to set debug level to 2 and see all statement types.
>>>> On Feb 2, 2013 12:58 PM, "Anja Liebermann" <cake@anjaliebermann.de>
> wrote:
>>>>
>>>> Hello everybody,
>>>>
>>>> I need help to find out why my model isn't saving. I use version 1.3.14
>>>> and develop with Cake since some years but at this moment I am
>>>> completely stuck. Duh...
>>>>
>>>> I have Model A which hasOne Model B. B belongsTo A.
>>>>
>>>> In controller B I try to move data from B to A by calling after some
>>>> transformations
>>>> $this->B->A->save($this->data).
>>>> That worked fine until I did some changes to my code and now I am stuck
>>>> with a boolean false for this saving attempt. The data also really isn't
>>>> saved to my table. But why?
>>>> $this->data contains of course an array with ['A'] and all the data
>>>> which should go to A.
>>>>
>>>> I already disabled any beforeSave and validation rules, but still no
> save.
>>>>
>>>> My question: How can I see with which sql statement Cake tries to add
>>>> the data to my table? All I found is ways to see the select statements,
>>>> but none for inset / update statements.
>>>>
>>>> Any hints on that would be appreciated and of course hints for other
>>>> things I can try to find the source of my error, too!
>>>>
>>>> Hope I listed all information needed.
>>>>
>>>>
>>>> Calamity Jane
>>>>>
>>>>> --
>>>>> Like Us on FaceBook https://www.facebook.com/CakePHP
>>>>> Find us on Twitter http://twitter.com/CakePHP
>>>>>
>>>>> ---
>>>>> You received this message because you are subscribed to the Google
> Groups
>>>>> "CakePHP" group.
>>>>> To unsubscribe from this group and stop receiving emails from it, send
> an
>>>>> email to cake-php+unsubscribe@googlegroups.com.
>>>>> To post to this group, send email to cake-php@googlegroups.com.
>>>>> Visit this group at http://groups.google.com/group/cake-php?hl=en.
>>>>> For more options, visit https://groups.google.com/groups/opt_out.
>>>>>
>>>>>
>>>>>
>>>>
>
>>
>> --
>> Like Us on FaceBook https://www.facebook.com/CakePHP
>> Find us on Twitter http://twitter.com/CakePHP
>>
>> ---
>> You received this message because you are subscribed to the Google Groups
>> "CakePHP" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to cake-php+unsubscribe@googlegroups.com.
>> To post to this group, send email to cake-php@googlegroups.com.
>> Visit this group at http://groups.google.com/group/cake-php?hl=en.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>>
>>
>

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)

iEYEARECAAYFAlENfKIACgkQbOdiIJzHNKF/kACgqaW7XBI0AuiDjecCnGYq1u+1
c/EAnRMU8T/9m8CZvDfTSKRCmROwyxiA
=6Uof
-----END PGP SIGNATURE-----

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.

No comments: