无法提交我的 drupal 表单;它有一个更新查询
我正在制作一个自定义模块,它还允许编辑页面来编辑特殊节点。 字段下方有一个更新按钮;所以我为这一切制作了一个表格 以下是我的表单的 hook_submit
function game_week_edit_form_submit($form_id, &$form_state)
{
$result = db_query("UPDATE {game_week} SET
start_time = %s, open_time = %s , close_time = %s WHERE game_week_id= %d",
$form_state['values']['start_time'], $form_state['values']['open_time'],
$form_state['values']['close_time'],$form_state['values']['game_week_id']);
}
I am making a custom module which also enables an edit page to edit the special node .
Below the feilds there is an update button ; so i have made a form for all this and
following is my hook_submit for the form
function game_week_edit_form_submit($form_id, &$form_state)
{
$result = db_query("UPDATE {game_week} SET
start_time = %s, open_time = %s , close_time = %s WHERE game_week_id= %d",
$form_state['values']['start_time'], $form_state['values']['open_time'],
$form_state['values']['close_time'],$form_state['values']['game_week_id']);
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您需要用引号将查询中的字符串括起来:
如果不是这样,请在最近的日志条目中查找任何数据库失败 - admin/reports/dblog
You need to wrap your strings in the query with quotes:
If that's not it, look in the recent log entries for any db fails - admin/reports/dblog