This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 10 years ago.
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(5)
这有点困难,因为您没有提供确切的错误消息。
但是,您可能使用列名“require”,它是 MySQL 中的保留关键字。关键字“date”也被保留,但由于它的广泛使用,它是被允许的。
尝试更改表和查询中的列名称“require”。
在这里查看更多信息; http://dev.mysql.com/doc/refman/5.0 /en/reserved-words.html
如果不是这样,请提供完整的错误消息。
It is a little difficult because you haven't provided the exact error message.
However, it could be that you use the column name 'require' which is a reserved keyword in MySQL. The keyword 'date' is also reserved but due to it's widespread use it's allowed.
Try changing the column name 'require' in your table and query.
Look here for more information; http://dev.mysql.com/doc/refman/5.0/en/reserved-words.html
If that's not it then please provide the full error message.
作为一般的 php/mysql 调试策略
打印出实际的查询,并插入值。有时,仅此一点就会使问题变得明显。
如果有,请将查询复制并粘贴到 phpMyAdmin / mysql 工作台中,然后查看它给出的错误消息。如果您无权访问其中任何一个,只需在 php 脚本中调用 mysql_error() 并查看它给您带来的错误。
As a general php/mysql debugging strategy
Print out the actual query, with the values inserted. Sometimes that alone will make the problem obvious.
If you have it, copy + paste the query into phpMyAdmin / mysql workbench and see what error message it gives you. If you don't have access to either of those, just call mysql_error() in the php script and see what error it gives you.
看起来
require
是 您用作列名称的 MySQL 保留字。要解决此问题,您可以选择不同的列名称或将其放在反引号中,如下所示:
Looks like
require
is a MySQL reserved word which you are using as a column name.To fix this you can either choose a different column name or place it in back ticks as:
尝试使用
或 die($sql.' - '.mysql_error());
来查看它认为其处理的内容。Try using
or die($sql.' - '.mysql_error());
to see what it thinks its processing.输入字段日期,例如“日期”
type the field date like `date`