首页 PHP 正文
  • PHP
  • 本文约229字,阅读需1分钟
  • 20423
  • 0

TP5执行插入/更新语句报The active result for the query contains no fields.

$link = Db::connect(msConfig($serverInfo));
$sql = "insert into Table (field1,field2...) VALUES (value1,value2...)";
//使用query的话会报错:The active result for the query contains no fields.
$link->query($sql);
//所以执行更新或插入操作,应该使用execute
$link->execute($sql);
评论
更换验证码
友情链接