postgresql qt中的更新不适用于sql数据库

zengzsys  于 2022-11-29  发布在  PostgreSQL
关注(0)|答案(1)|浏览(122)

这是我的代码,数据库不更新在qt.

QSqlQuery query;
query.prepare("UPDATE employee SET initials = :initials WHERE employee_id =:employee_id;");
query.bindValue("initials", "Karter");
query.bindValue(":employee_id", 5);
query.exec();
2izufjch

2izufjch1#

谢谢Adrian我漏了一个结肠

QSqlQuery query;
query.prepare("UPDATE employee SET initials = :initials WHERE employee_id =:employee_id;");
query.bindValue(":initials", "Karter");//missed : here
query.bindValue(":employee_id", 5);
query.exec();

相关问题