简体   繁体   English

找不到基本表或视图:1146表'username.gallery_images'

[英]Base table or view not found: 1146 Table 'username.gallery_images'

I am coming across a problem at the moment when I create a post and try to save it from a scaffold I setup. 创建帖子并尝试从我设置的支架中保存时,我遇到了一个问题。 Here is the paste for you to see the code: http://paste.jesse-obrien.ca/jE 这是粘贴,供您查看代码: http : //paste.jesse-obrien.ca/jE

I have used this package in my app: https://github.com/CodeSleeve/stapler 我已经在我的应用程序中使用了这个包: https : //github.com/CodeSleeve/stapler

It seems to be trying to save the post but when it comes to the db it throws this error: 似乎正在尝试保存帖子,但是当涉及到数据库时,它将引发以下错误:

SQLSTATE[42S02]: Base table or view not found: 1146 Table 'markdunbavan.gallery_images' doesn't exist (SQL: insert into `gallery_images` (`photo_file_name`, `photo_file_size`, `photo_content_type`, `photo_updated_at`, `post_id`, `updated_at`, `created_at`) values (1.png, 34584, image/png, 2014-02-01 15:24:54, , 2014-02-01 15:24:54, 2014-02-01 15:24:54))

I am trying to look at what it might be but I have hit a brick wall. 我正在尝试查看可能是什么,但我碰到了墙。

Can anyone help? 有人可以帮忙吗?

Cheers 干杯

数据库markdunbavan中不存在表gallery_images

One strange issue that I had with this kind of error is that sometimes I simply change the name of my model and everything works. 我遇到这种错误时遇到的一个奇怪问题是,有时我只是简单地更改模型的名称,然后一切正常。 Also try other avaliable methods like insert or create instead save. 也可以尝试其他可用的方法,例如插入或创建,而不是保存。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM