How do i find if my update is successful or not? i update using a where uniqueName=name so i should always only update 0 rows or 1. What is a good way to check if i updated
I'm pretty late here, but you could always force a failure on no match by changing your query.
For table 'foo' with columns 'ID' and 'value'. Match expression: ID = 4
update foo
join (select ID as nearID,
ID = 4
as matched from foo order by matched desc limit 0, 1) as t on nearID = ID
set value='somedata2'
, ID = if(matched, nearID, 'nomatch')
It's probably easier just to change the table to include either an update timestamp or sequence number instead though. (since those would change on every update)