SQL UPDATE - returns success, but 0 rows

I am sending an SQL UPDATE query, and the mySQL database is behaving strangely. It returns a successful response, but it is affected by 0 lines. The code:

UPDATE place 
SET city='Qatar' AND country='Qatar'
WHERE placeid='25'

Response: Successful 0 row(s) affected. ( Query took 0.0003 sec )

There is definitely a record in the database with placeid = '25 '. If I do SELECT * FROM place WHERE placeid = '25 ', I get a record.

Any ideas? thank!

EDIT:

Table structure:

SQL query: describe place; 
Rows: 9

Field         Type     Null   Key    Default  Extra
title         text     NO            NULL     
description   text     NO            NULL     
latitude      float    NO            NULL     
longitude     float    NO            NULL     
image         text     NO            NULL     
placeid       int(11)  NO     PRI    NULL     
country       text     YES           NULL     
city          text     YES           NULL     
address       text     YES           NULL     
+3
source share
3 answers

Try the following:

UPDATE place 
SET city='Qatar', country='Qatar'
WHERE placeid=25

Because yours sounds weird in your request. AND

+16
source

, MySQL "" , . Workbench, ( "a" "b" ):

update t.t set s = 'b', k > 0 | 1 (-) : 1 : 1 : 0

( "b" "b" ):

update t.t set s = 'b', k > 0 | 0 () : 1 : 0 : 0

, .

+2

Are you sure placeId is varchar but not numeric? did you try without it? "

UPDATE place  SET city='Qatar' AND country='Qatar' WHERE placeid=25
-1
source

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


All Articles