gpt4 book ai didi

php - 为什么 Doctrine 不能清除我的数据库? Doctrine 的语法错误

转载 作者:行者123 更新时间:2023-11-29 05:28:17 25 4
gpt4 key购买 nike

每当我尝试加载我的数据夹具时,我都会收到此错误:

  [Doctrine\DBAL\DBALException]                                                
An exception occurred while executing 'DELETE FROM Group':

SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error i
n your SQL syntax; check the manual that corresponds to your MySQL server v
ersion for the right syntax to use near 'Group' at line 1

我不想修改 Doctrine ,但显然它没有使用正确的语法。我需要以不同方式配置 Doctrine 吗?我将 smyfony2 与 mysql 和基本 Doctrine 包一起使用。下面是我的 composer.json 文件:

"require": {
"php": ">=5.3.3",
"symfony/symfony": "2.3.*",
"doctrine/orm": ">=2.2.3,<2.4-dev",
"doctrine/doctrine-bundle": "1.2.*",
"twig/extensions": "1.0.*",
"symfony/assetic-bundle": "2.3.*",
"symfony/swiftmailer-bundle": "2.3.*",
"symfony/monolog-bundle": "2.3.*",
"sensio/distribution-bundle": "2.3.*",
"sensio/framework-extra-bundle": "2.3.*",
"sensio/generator-bundle": "2.3.*",
"incenteev/composer-parameter-handler": "~2.0",
"doctrine/orm": "*",
"phpunit/phpunit": "3.7.*",
"doctrine/doctrine-migrations-bundle": "dev-master",
"doctrine/migrations": "dev-master",
"doctrine/doctrine-fixtures-bundle": "dev-master",
"doctrine/data-fixtures": "dev-master",
"ircmaxell/password-compat": "dev-master"
},

最佳答案

Groupmysql 中的关键字。所以你可能想逃避它。

DELETE FROM `Group`

关于php - 为什么 Doctrine 不能清除我的数据库? Doctrine 的语法错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17509227/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com