Wednesday, May 9, 2012

Re: Error: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax;

It's not clear, because you didn't actually show where
erstelleAuswahl() is being called. But this error will happen when you
call a model method which doesn't exist. Cake will pass it directly to
the database, which of course knows nothing about it.

I think what you've done (somewhere) is:

$this->Kunde->erstelleAuswahl()

The problem is that this method is in KundenController, not the Kunde
model. Move the method into the model and change all
$this->Kunde->something to $this->something.

On Wed, May 9, 2012 at 7:14 PM, support@deep-coding.net
<support@deep-coding.net> wrote:
> Thanks for your answer, but I can't find the error.
> My Controller looks like this:
>
> KundenController.php
> <?php
>
> class KundenController extends AppController {
>
>    var $name = 'Kunde';
>    ....
> ?>
>
> Kunde.php (App/Model)
> <?php
>
> class Kunde extends AppModel {
>
>    public $name = 'Kunde';
>    public $useTable = 'kunden';
>    public $hasMany = array(
>        'Vertrag' => array(
>            'className' => 'Vertrag',
>            'foreignKey' => 'vn_id'
>        )
>    );
>
> }
>
> ?>
>
> And here I am calling the function erstelleAuswahl()
> VertraegeController.php
> <?php
>
> class VertraegeController extends AppController {
>    public $name = 'Vertrag';
>    public $uses = array('Schluessel', 'Kunde', 'Vertrag');
> .....
> ?>
>
> --
> Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org
> Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions.
>
>
> To unsubscribe from this group, send email to
> cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php

--
Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate