查询更新不起作用

时间:2014-03-02 17:52:41

标签: php mysql sql

我正在使用MySQLi,我现在想要一个表单来编辑数据库中的一些条目,当然我想更新数据库中的数据。但由于某种原因没有任何事情发没有错误..我已经使用var_dump来查看php脚本是否从表单获取数据,工作正常。 也许有人可以在更新代码中发现任何错误。

$con->query("UPDATE anime SET 
 epcount = '".$eps."',
 original_title = '".$otitle."',
 japan_title = '".$jtitle."',
 english_title = '".$etitle."',
 genres = '".$genres."',
 studio = '".$studio."',
 season = '".$season."',
 year = '".$year."',
 state = '".$status."',
 type = '".$type."',
 manifestations = '".$manif."',
 trailer = '".$trailer."',
 description = '".$des."' WHERE id = '$animeId");

1 个答案:

答案 0 :(得分:1)

最后一行的问题

$con->query("UPDATE anime SET 
 epcount = '".$eps."',
 original_title = '".$otitle."',
 japan_title = '".$jtitle."',
 english_title = '".$etitle."',
 genres = '".$genres."',
 studio = '".$studio."',
 season = '".$season."',
 year = '".$year."',
 state = '".$status."',
 type = '".$type."',
 manifestations = '".$manif."',
 trailer = '".$trailer."',
 description = '".$des."' WHERE id = '".$animeId."'");

同样以这种方式进行查询是一种不好的做法