Why mysql returns true when false

I have a problem. for example, this code DELETE FROM guru WHERE id=2returns true when in the database mysql. only there is data with id = 1 in mysql. should return false, because id = 2 in the syntax above. so I'm embarrassed, help me please. I'm sorry my English is less fluent.

+4
source share
2 answers

The operation DELETEwill succeed if the syntax is correct and the table guruexists in the database to which you are connected. A falseis what happens specifically when the request encounters an error and asks for deletion in rows that do not exist is not an error.

, , , .

+6

MySql delete query true false . , true.

No , , - .

+1

Source: https://habr.com/ru/post/1655724/


All Articles