473,549 Members | 2,862 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

SQLSTATE[42000]: Syntax error or access violation

132 New Member
Hello,

I do this Script the Doctrine on zend Framework 2

Expand|Select|Wrap|Line Numbers
  1. $qb = $entityManager->createQueryBuilder ();
  2.             $qb->select ( 'g' )->from ( 'Synchro\Entity\Group', 'g' )->where ( 'g.namegroup = :namegroup' )->setParameter ('namegroup', $nameGroup );
  3.             $query = $qb->getQuery ();
  4.             try {
  5.                 $checkgroup = $query->getResult();
  6.  
  7.                 if(!empty($checkgroup)){
  8.  
  9.                     return $checkgroup[0]->getIdgroup();
  10.                 }
  11.             } catch (\Doctrine\ORM\NoResultException $e) {
  12.                 return null;
  13.             }
I have this Error :

SQLSTATE[42000]: Syntax error or access violation: 1064 Erreur de syntaxe près de 'group g0_ WHERE g0_.nameGroup = 'GroupPOUR TOUTE INFORMATION'' à la ligne 1
How can i resolve This Issue ? Thanks In advance
Apr 1 '16 #1
1 1562
Dormilich
8,658 Recognized Expert Moderator Expert
group is part of the GROUP BY keyword and as such not a valid table name (unless you quote it correctly, but I don’t know how to tell Doctrine to do that).

tl;dr "group" is a very bad choice for a table name
Apr 2 '16 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

6
7374
by: nobody | last post by:
Hi: I am using Visual Studio .NET 2003 and console project (disabled precompiled header). I am using _tcstok() which resolves to strtok in my case. It keeps crashing (unhandled error, access violation). Firt I thought my variable wasn't writtable (const) but it wasn't so I used literal as input but it still crashes.
0
2090
by: Mike Thomas | last post by:
This one must be very simple. I am trying to run an SQL Serv 7.0 stored proc from a VBA module in an Access 2000 app. This stored proc runs fine when I remove the parameters from the stored proc and from the CommandText string below, but when I run it as is I get the error SQL Serv Syntax Error or Access Violation on the "Execute" line. ...
7
3123
by: Daniel | last post by:
I want to write a method to remove the last node of the linked list. But the error "Access Violation" exists and the error point to this method. What does it means by Access Violation and how can I debug it? Thanks void RemoveNode(StepNodePtr pList) { StepNodePtr preq, q; q = pList; preq = pList;
7
4868
by: GeRmIc | last post by:
Hi, I'm writing a C# Library that interacts with an C DLL, the resulting DLL is used by an application and it works fine on my PC but when i copy the resulting DLL to another PC running the same application it gives an error Access violation at address ..... in module ..... Read of address 0000000 Help!
0
2481
by: Bruce Pataki | last post by:
I am creating an MFC application with activeX document server support. The application runs perfectly fine when i run as a standalone application. But when i run the application in Internet explorer, it opens however opening a form from the top menubar, it gives an error "access violation reading location" having error code 0xC0000005 (Running...
2
2880
by: Curten | last post by:
Hi, I want to read data from a txt-file that looks like this: aaa 4 12.45 bbb 3 7.34 ccc 12 3.45 and store the data in an array of structures. The struct and array are defined like this
2
4665
by: J W | last post by:
I have an ASP page in which there is embedded SQL. I am trying to use variables in the SQL but am getting the error 'syntax error or access violation'. In the past, I have successfully used variables for table names and within WHERE clauses in SQL in an ASP page. This time, I am trying to use variables in the SELECT portion of an INSERT...
3
8035
by: Pinux | last post by:
Hi, I am writing a multi-threads encryption application. The idea of the code is to create a number of threads to encrypt files. I have a thread pool say the maximum threads is 10. If the number of tasks (number of files waiting to be encrypted) is larger than the thread pool size, I first create 10 new threads to execute the encryption...
2
2348
by: RAG2007 | last post by:
Hi, I'm running an ADP with SQL Server as back end. On a main form, my subform is coming up blank. When I was running as an mdb with no back end I didn't have this problem. I get an error "Syntax error access violation", and the subform is all white, not even any empty fields. I'm not even sure where to begin to look for the issue. Thanks,...
39
4235
by: Martin | last post by:
I have an intranet-only site running in Windows XPPro, IIS 5.1, PHP 5.2.5. I have not used or changed this site for several months - the last time I worked with it, all was well. When I tried it just now, I am getting the subject error message (specifically: PHP has encountered an access violation at 00F76E21). The error is NOT occurring...
0
7518
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7715
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7956
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7469
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7808
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6040
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5368
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
1
1935
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1057
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.