0

Possible Duplicate:
What does a successful MySQL DELETE return? How to check if DELETE was successful?

Hello,

If I run a delete query, what is the php/mysql error code returned if a row was actually found and deleted or not found (and hence not deleted)?

Community
  • 1
  • 1
David19801
  • 10,694
  • 24
  • 81
  • 123

3 Answers3

0

Use mysql_affected_rows().

ThiefMaster
  • 298,938
  • 77
  • 579
  • 623
0

You can examine mysql_affected_rows() for that. But there no function, that can tell you which specific rows were updated or deleted by previous DML statement.

Vladislav Rastrusny
  • 28,763
  • 23
  • 91
  • 155
0

Don't use the error code. Call mysql_affected_rows.

Oswald
  • 30,441
  • 3
  • 40
  • 68