QSqlError(2036, "QMYSQL3: Unable to bind value"



  • QSqlError(2036, "QMYSQL3: Unable to bind value", "Using unsupported buffer type: 538976308 (parameter: 1)")

    数据库打开了,成功了,没有关闭,然后我执行更新错做。
    @
    int USessionId=100;
    bool value =query.prepare("UPDATE users SET SessionId = ? WHERE UserID = userID");
    query.bindValue(0,USessionId);
    query.exec();@
    这样写总是不能更新数据,但是这样写就可以,不知道为什么??
    @
    int USessionId=100;
    bool value =query.prepare("UPDATE users SET SessionId = ? WHERE UserID = userID");
    query.bindValue(0,100);
    query.exec();@

    bindValue里面不可以给变量吗??



  • 是不是其它的地方导致的问题呢?我觉得这样并没有任何问题。


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.