选择MySQL表的最后一行并编辑并更改其布尔值

I am looking for the correct way to go about selecting the last row of a table and then change a value of a column(boolean) to true.

I am unsure if it is possible if you can do it with one PDO query or not.

What does last row means? Implicit row order is set on pk per default so order by your pkrow desc should be ok

UPDATE mytable
SET myField = 'TheVal'
ORDER by id desc
limit 1

You might query the last row within this

SELECT * FROM myfield ORDER BY id DESC LIMIT 0,1

After that you check on your page or your stored procedure after that you update within the update syntax.