Symfony2:找不到基表或视图:1146

2023-08-19php开发问题
0

本文介绍了Symfony2:找不到基表或视图:1146的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

问题描述

我正在和一个朋友一起做一个 Symfony2 项目.他在一台基于 Windows 的计算机上工作,而我在我的 Mac 上工作.我们设置了项目并在他的计算机上制作了数据库模型/实体(代码优先).现在我也想开始研究它,所以我们对我的本地主机做了一个 SQL 哑巴.我编辑了 parameters.yml 以匹配我的设置.该项目可以连接到服务器.但是,当我尝试打开使用数据库的页面时,出现此错误:

Hi, I"m working with a friend on a Symfony2 project. He's working on a Windows based computer and I'm on my Mac. We setup the project and made the database model / entities (code first) on his computer. Now I wanted to start working on it as well so we did a SQL dumb to my localhost. I edited the parameters.yml to match my settings. The project can connect to the server. But when I try to open a page where the database is used i get this error:

执行'SELECT t0.id AS id1, t0.name AS name2, t0.bigimage AS bigimage3, t0.smallimage AS smallimage4, t0.info AS info5, t0.city_id AS city_id6 FROM District t0'时发生异常:

An exception occurred while executing 'SELECT t0.id AS id1, t0.name AS name2, t0.bigimage AS bigimage3, t0.smallimage AS smallimage4, t0.info AS info5, t0.city_id AS city_id6 FROM District t0':

SQLSTATE[42S02]:未找到基表或视图:1146 表 'socialgeogroep6.District' 不存在500 内部服务器错误 - DBALException1 个链接异常:PDOException

SQLSTATE[42S02]: Base table or view not found: 1146 Table 'socialgeogroep6.District' doesn't exist 500 Internal Server Error - DBALException 1 linked Exception: PDOException

需要说明的是,页面在他的电脑上运行正常;他得到了应有的数据.


Just to be clear, the page is running normal on his computer; he gets the data as it should be.


可能是什么问题?我一遍又一遍地查看我的 PHPmyAdmin,数据库中包含所有字段和数据...
(屏幕:http://gyazo.com/4a0e5f1ee6b1e29d2d277df5fc0d8aac)我真的无法想象这是什么问题.

What can be the problem? I looked in my PHPmyAdmin over and over again and the database is there with all the fields and data...
(screen: http://gyazo.com/4a0e5f1ee6b1e29d2d277df5fc0d8aac) I really can't imagine what the problem is.

希望有人能帮助我们!

推荐答案

这可能是一个案例问题.您的数据库中有 district 表,但学说要求的是 District 表.

It's likely a case issue. You have the district table on your database, but doctrine is asking for the District table.

您应该配置学说以使用小写的表名.参考学说文档 http://docs.doctrine-project.org/projects/doctrine-orm/en/latest/reference/basic-mapping.html#persistent-classes 了解如何操作.

You should configure doctrine to use lower case table name. Refer to the doctrine documentation http://docs.doctrine-project.org/projects/doctrine-orm/en/latest/reference/basic-mapping.html#persistent-classes to know how to do so.

这篇关于Symfony2:找不到基表或视图:1146的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

The End

相关推荐

PHP实现DeepL翻译API调用
DeepL的翻译效果还是很强大的,如果我们要用php实现DeepL翻译调用,该怎么办呢?以下是代码示例,希望能够帮到需要的朋友。 在这里需要注意,这个DeepL的账户和api申请比较难,不支持中国大陆申请,需要拥有香港或者海外信用卡才行,没账号的话,目前某宝可以...
2025-08-20 php开发问题
168

PHP通过phpspreadsheet导入Excel日期数据处理方法
PHP通过phpspreadsheet导入Excel日期,导入系统后,全部变为了4开头的几位数字,这是为什么呢?原因很简单,将Excel的时间设置问文本,我们就能看到该日期本来的数值,上图对应的数值为: 要怎么解决呢?进行数据转换就行,这里可以封装方法,或者用第三方的...
2024-10-23 php开发问题
287

mediatemple - 无法使用 codeigniter 发送电子邮件
mediatemple - can#39;t send email using codeigniter(mediatemple - 无法使用 codeigniter 发送电子邮件)...
2024-08-23 php开发问题
11

Laravel Gmail 配置错误
Laravel Gmail Configuration Error(Laravel Gmail 配置错误)...
2024-08-23 php开发问题
16

将 PHPMailer 用于 SMTP 的问题
Problem with using PHPMailer for SMTP(将 PHPMailer 用于 SMTP 的问题)...
2024-08-23 php开发问题
4

关于如何在 GoDaddy 服务器中使用 PHPMailer 设置 SMTP 的问题
Issue on how to setup SMTP using PHPMailer in GoDaddy server(关于如何在 GoDaddy 服务器中使用 PHPMailer 设置 SMTP 的问题)...
2024-08-23 php开发问题
17