Symfony 1.4,推进:当我尝试保存记录时,会导致 500 错误
我所拥有的是:
$rec = new Users();
$rec->setUsername($username);
$rec->setPassword(md5($password));
$rec->setEmail($email);
$rec->setRealname($rname);
$rec->save();
save()
方法触发 symfony 中的内部错误 (500)。架构:
users:
_attributes: { phpName: Users }
ID: { type: INTEGER, size: '10', primaryKey: true, autoIncrement: true, required: true }
USERNAME: { type: VARCHAR, size: '255', required: true, defaultValue: '' }
PASSWORD: { type: VARCHAR, size: '255', required: true, defaultValue: '' }
EMAIL: { type: VARCHAR, size: '255', required: true, defaultValue: '' }
REALNAME: { type: VARCHAR, size: '255', required: false }
STATUS_: { type: CHAR, required: true, defaultValue: '2' }
NUMBEROFDELETEDAUCTIONS: { type: INTEGER, size: '10', required: true, defaultValue: '0' }
NUMBEROFSUCCEEDAUCTIONS: { type: INTEGER, size: '10', required: true, defaultValue: '0' }
_uniques: { Index_USERNAME: [USERNAME] }
有人能看出原因吗?
All I have is:
$rec = new Users();
$rec->setUsername($username);
$rec->setPassword(md5($password));
$rec->setEmail($email);
$rec->setRealname($rname);
$rec->save();
the save()
method triggers internal error (500) in symfony. The schema:
users:
_attributes: { phpName: Users }
ID: { type: INTEGER, size: '10', primaryKey: true, autoIncrement: true, required: true }
USERNAME: { type: VARCHAR, size: '255', required: true, defaultValue: '' }
PASSWORD: { type: VARCHAR, size: '255', required: true, defaultValue: '' }
EMAIL: { type: VARCHAR, size: '255', required: true, defaultValue: '' }
REALNAME: { type: VARCHAR, size: '255', required: false }
STATUS_: { type: CHAR, required: true, defaultValue: '2' }
NUMBEROFDELETEDAUCTIONS: { type: INTEGER, size: '10', required: true, defaultValue: '0' }
NUMBEROFSUCCEEDAUCTIONS: { type: INTEGER, size: '10', required: true, defaultValue: '0' }
_uniques: { Index_USERNAME: [USERNAME] }
can anybody see the reason why?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
为什么不使用开发环境以便可以查看有关错误的更多详细信息?而不是 http://www.blabla.com/index.php 只需使用 http://www.blabla.com/NAME_OF_YOUR_APP_dev.php(通常是 frontend_dev.php)
Why don't you use the dev environment so you can see more details about the error? Instead of http://www.blabla.com/index.php just use http://www.blabla.com/NAME_OF_YOUR_APP_dev.php (usually frontend_dev.php)
为什么你的架构是大写的?
异常错误信息是什么?
你尝试过这样的事情吗?
不管怎样,这个模式有很多违反 symfony 标准的情况。也许它是强加给你的,但如果不是,请查看一些文档< /a>.
Why are your schema uppercased?
What's the exception error message?
Have you tried with something like this?
Anyway, there is a lot of symfony standards violation on this schema. Maybe it's imposed to you, but if it's not, please look at some documentation.