语法错误或访问违反:1064 Erreur de syntaxe。

时间:2020-12-19 15:51:41

When trying to run this code in Zend 2 with doctrine 2 with this Script :

当试图在Zend 2中运行这段代码时,使用这个脚本:

$query = $entityManager->createQuery('SELECT u FROM  \Synchro\Entity\Group u WHERE u.namegroup=:namegroup');
            $query->setParameters(array(
                    'namegroup' =>$nameGroup
                    ));

$datagroup['nameGroup'] = "Group_".$companyinfo['cprenom']."".$companyinfo ['cnom'];

i get this Error :

我得到了这个错误:

SQLSTATE[42000]: Syntax error or access violation: 1064 Erreur de syntaxe près de 'group g0_ WHERE g0_.nameGroup = 'GroupPETIT'' à la ligne 1

SQLSTATE[42000]:语法错误或访问违例:1064错误de syntaxe prA¨年代德集团g0_,g0_.nameGroup = GroupPETIT”la线1

i ver_dumped the $nameGroup i get string 'GroupPETIT', how can i resolved that Thanks in advance

我向$nameGroup抛出了一个“GroupPETIT”,我怎么能提前表示感谢呢?

1 个解决方案

#1


0  

It looks like $companyinfo ['cprenom'] is an array. Trying dumping it, and also there is space between $companyInfo and ['cprenom']. Hope there is no space in the code.

它看起来像公司信息['cprenom']是一个数组。试着抛弃它,还有公司信息和['cprenom']之间的空间。希望代码中没有空格。

#1


0  

It looks like $companyinfo ['cprenom'] is an array. Trying dumping it, and also there is space between $companyInfo and ['cprenom']. Hope there is no space in the code.

它看起来像公司信息['cprenom']是一个数组。试着抛弃它,还有公司信息和['cprenom']之间的空间。希望代码中没有空格。