MySql General error: 2053

前端 未结 1 1447
北荒
北荒 2020-12-11 03:44

I\'m getting the error:

ERROR: SQLSTATE[HY000]: General error: 2053

I have no idea why this is happening because the code works

相关标签:
1条回答
  • 2020-12-11 03:56

    $row = $stmt->fetch(PDO::FETCH_ASSOC); is the line that will cause your error.

    Why?

    Because there's nothing to fetch - in array - after an update

    Remember that

    PDO::FETCH_ASSOC: returns an array indexed by column name as returned in your result set

    So, no result set ... no party

    If you want to know exit status of your command, just use the return value of execute() function

    $rv = $stmt->execute(array('USERNAME' => $USERNAME));

    0 讨论(0)
提交回复
热议问题