Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试使用 NOTORM 库更新单个记录。我有一个用户 ID,需要更新密码列。我找不到任何仅更新一条记录的代码示例。这是现在不起作用的代码,它会更新每条记录,而不是仅更新具有正确用户ID的记录。
$dbdata = array( "Password" => $password ); $result = $db->$databasetable->where("id = ?", $userdata['UserID'])->update($dbdata); echo $result;
尝试这个:
$dbdata = array( "Password" => $password ); $user = $db->$databasetable->where("id = ?", $userdata['UserID'])-fetch() if ($user !== false) { $result = $user->update($dbdata); echo $result; } else { //TODO; }
$result 受影响的行