简体   繁体   English

查询更新不起作用

[英]Query Update does not work

I'm working with MySQLi and I wanted now I made a form to edit some entries in the database and of course I want to update the data in the database. 我正在使用MySQLi,现在我想制作一个表格来编辑数据库中的某些条目,当然我想更新数据库中的数据。 But for some reason nothing happen. 但是由于某种原因,什么也没发生。 No error either.. I allready used var_dump to see if the php script is getting the data from the form, works fine. 也没有错误。.我已经使用var_dump来查看php脚本是否从表单获取数据,效果很好。 Maybe someone can find any mistakes at the update code. 也许有人可以在更新代码中发现任何错误。

$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");

The problem in the last line 最后一行的问题

$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."'");

Also making the query in this style is a bad practice 同样以这种方式进行查询也是一种不好的做法

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

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