Home > database >  I can't update my table in MySQL. Rows matched: 0 Changed: 0 Warnings: 0
I can't update my table in MySQL. Rows matched: 0 Changed: 0 Warnings: 0

Time:08-19

I have never had problems like this and I can't find the problem. https://i.stack.imgur.com/RJBCK.png

  1. CREATE TABLE setting_cube(i INT, subject VARCHAR(30));

Query OK, 0 rows affected (0.03 sec)

  1. UPDATE setting_cube SET i='1', subject='#uno';

Query OK, 0 rows affected (0.01 sec) Rows matched: 0 Changed: 0 Warnings: 0

and if I try:

  1. SELECT * FROM setting_cube;

Empty set (0.00 sec)

even though I have updated the table... What am I doing wrong? thank youuuu!!!

CodePudding user response:

The table is empty. You should insert some rows before updating them in the second step:

INSERT INTO setting_cube VALUES (1, 'first row');

CodePudding user response:

Create TABLE setting_cube(i INT, subject VARCHAR(30)); ----First you need to insert some x date insert into setting_cube values (1 ,'Test') ---Now You can Update table update setting_cube set i = 1 , subject = '#uno'

select * from setting_cube

  • Related